By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,462 Members | 1,456 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,462 IT Pros & Developers. It's quick & easy.

Export To Excel Problem

P: n/a
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.Cultur eInfo.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
Nov 16 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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
--------------------------------------------------
"kscdavefl" <ks*******@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
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.Cultur eInfo.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

Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.