Datagrid --> Excel Spreadsheet - A "small detail" question

Discussion in 'ASP .Net Datagrid Control' started by Dave, Aug 9, 2004.

  1. Dave

    Dave Guest

    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
    Dave, Aug 9, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. FSD
    Replies:
    0
    Views:
    1,188
  2. Tim Marsden

    Displaying an Excel spreadsheet

    Tim Marsden, Feb 20, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    2,643
    S. Justin Gengo
    Feb 20, 2004
  3. Dave
    Replies:
    0
    Views:
    459
  4. =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=

    Problem with Excel reports ::::Excel 2003 Migration To Excel 2007

    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=, Oct 5, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    1,494
    =?Utf-8?B?c2hhc2hhbmsga3Vsa2Fybmk=?=
    Oct 24, 2007
  5. Datagrid to emulate Excel Spreadsheet

    , Feb 17, 2007, in forum: ASP .Net Datagrid Control
    Replies:
    3
    Views:
    869
    Alvin Bruney [MVP]
    Feb 27, 2007
Loading...

Share This Page