D
Dave
In a VB.NET application, I have a datagrid that I export to an Excel
spreadsheet like this:
' Set the content type to Excel
Response.ContentType = "application/vnd.ms-excel"
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
' Get the HTML for the control.
DataGrid1.RenderControl(hw)
' Write the HTML back to the browser.
Response.Write(tw.ToString())
In the datagrid, I use colored backgrounds. There is a default white
background, and four other colors that I use. After exporting, the
spreadsheet only retains the white background and one of the other colors
(System.Drawing.Color.FromName("#e38a00"). The other three colors (nothing
special - ff0000, 00ff00, ffff00 - red, green, and yellow) are lost in the
move.
Now, my questions:
- Am I supposed to be able to maintain colored cells during the move?
- If so, do you know or see anything obvious I need to do?
Thanks,
Dave
spreadsheet like this:
' Set the content type to Excel
Response.ContentType = "application/vnd.ms-excel"
Dim tw As New System.IO.StringWriter
Dim hw As New System.Web.UI.HtmlTextWriter(tw)
' Get the HTML for the control.
DataGrid1.RenderControl(hw)
' Write the HTML back to the browser.
Response.Write(tw.ToString())
In the datagrid, I use colored backgrounds. There is a default white
background, and four other colors that I use. After exporting, the
spreadsheet only retains the white background and one of the other colors
(System.Drawing.Color.FromName("#e38a00"). The other three colors (nothing
special - ff0000, 00ff00, ffff00 - red, green, and yellow) are lost in the
move.
Now, my questions:
- Am I supposed to be able to maintain colored cells during the move?
- If so, do you know or see anything obvious I need to do?
Thanks,
Dave