Output to Excel - White Cell Background.

I

iforsyth

I'm doing a query against a database table and outputting to Excel via
Response.ContentEncoding and Response.ContentType.

Something like the code below where dg is a DataGrid control.

Response.Clear()
Response.ContentType = "application/vnd.ms-excel"
Response.ContentEncoding = System.Text.Encoding.UTF8
dg.DataSource = objDR
dg.DataBind()
dg.RenderControl(hw)
strTW = tw.ToString()
Response.Write(strTW)
Response.Flush()
Response.Close()

Everything works fine and the query output generates in Excel, but I
get this icky white background in all of the cells on the sheet. Is
there a way to retain the Excel regular, transparent background?
 
Z

zPaul

You can create a <table> tag to format the output. Excel will interpret
whatever you put it in.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top