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?
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?