On Tue, 3 Aug 2004 15:23:18 -0500, "Dave" <(E-Mail Removed)> wrote:
¤ 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())
¤
¤
¤
¤ Now, my question is this: In the datagrid, I use colored text and
¤ backgrounds. After exporting, the spreadsheet loses this coloring.
¤
¤ - Am I supposed to be able to maintain colored cells?
¤
¤ - If so, do you know or see anything obvious I need to do?
The display colors, styles, fonts etc. are not exported from the DataGrid to the Excel Workbook. You
would need to change the formatting via Excel.
Paul ~~~
(E-Mail Removed)
Microsoft MVP (Visual Basic)