Export To Excel Problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I execute the following code:

private void excelButton_Click(object sender, System.EventArgs e)
{
Response.Clear();
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false;

System.IO.StringWriter tw = new
System.IO.StringWriter(System.Globalization.CultureInfo.CurrentCulture);
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
applicationPermissionGrid.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
}

Only the first three columns of the datagrid are exported to the excel
spreadsheet. Is there a reason the other 2 columns would no be exported as
well?

Thanks,

Dave
 
couple things to check, the grid in question must be on an aspx page by
itself with no other controls. you also need to verify that there is more
than three rows at the time or render.

--
Regards
Alvin Bruney
[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
available at www.lulu.com/owc
 
Back
Top