Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Output to Excel - White Cell Background.

Reply
Thread Tools

Output to Excel - White Cell Background.

 
 
iforsyth
Guest
Posts: n/a
 
      10-22-2003
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?
 
Reply With Quote
 
 
 
 
zPaul
Guest
Posts: n/a
 
      10-23-2003
You can create a <table> tag to format the output. Excel will interpret
whatever you put it in.

"iforsyth" <> wrote in message
news: om...
> 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?



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Any programs to trim white space/ remove all white space in HTML file? Ben C HTML 6 01-28-2007 11:41 PM
White font on white background???? Stubby Firefox 3 08-18-2006 04:25 PM
Custom White Balance: Gray Card or White Card? Steve Cutchen Digital Photography 31 10-28-2005 09:13 PM
Color.white vs. Color.WHITE Niels Dybdahl Java 3 10-06-2004 03:21 PM
Affects of a PL filter on white balance and white balance (D100) jeff liss Digital Photography 1 09-05-2003 02:07 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57