{
string style = @"<style> .text { mso-number-format:\@;border:.5pt solid black; } </style> ";
string attachment = "attachment; filename=Report.xls";
Response.ClearContent();
Response.Write("<center>");
Response.Write("Gross Profit Report");
Response.Write("</center>");
Response.AddHeader("content-disposition", attachment);
Response.ContentType = "application/ms-excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
GridView1.RenderControl(htw);
Response.Write(style);
Response.Write(sw.ToString());
Response.End();
}
3. put following code:
public override void VerifyRenderingInServerForm(Control control){
/* Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time. */}
1 comment:
repair Excel files Microsoft is able to find out, scan and recover excel files all formats. It restores fonts, columns, rows, formulas, worksheets and etc. excel data. Utility has the compatibility with Win 98 and higher.
Post a Comment