Click here to Skip to main content
15,898,134 members

Comments by farogh haider (Top 3 by date)

farogh haider 13-May-14 0:01am View    
Thanks, for replying me
Below code is using to generate excel.



public ActionResult ExportToExcelInvoiceInView(int sno)
{

gvUserInfo.DataSource = Datasource; // Binding with GridView
gvUserInfo.ShowFooter = true;

gvUserInfo.DataBind();

GridViewRow footerRow = gvUserInfo.FooterRow;
Label lbl = new Label();
lbl.Text = footer;
footerRow.Cells[lastColumnIndex].Controls.Add(lbl);

System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter htw = new System.Web.UI.HtmlTextWriter(sw);
gvUserInfo.RenderControl(htw);
byte[] buf = DocWriter.GetISOBytes(sw.ToString());
return new BinaryContentResult(buf, "Invoice.xls");

}
farogh haider 11-Sep-13 1:27am View    
Please post your code here.
farogh haider 2-Jul-13 7:11am View    
Plaese explian what do you want??(Footer in all pages or only specific page)