473,382 Members | 1,357 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Output to Excel - White Cell Background.

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?
Nov 17 '05 #1
2 2173
You can create a <table> tag to format the output. Excel will interpret
whatever you put it in.

"iforsyth" <do***********@yahoo.com> wrote in message
news:d8**************************@posting.google.c 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?

Nov 17 '05 #2
You can create a <table> tag to format the output. Excel will interpret
whatever you put it in.

"iforsyth" <do***********@yahoo.com> wrote in message
news:d8**************************@posting.google.c 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?

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: nivas.meda | last post by:
Hi, I have an excel sheet with a graph and cells.If i change the value in the excel cells the graph will reflect.Now i am going to implement this functionality in html page.I successfully saved...
0
by: iforsyth | last post by:
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. ...
0
by: Steven | last post by:
Hi All, Is there any method to copy the MSFlexGrid data (including the text color, cell background color etc) to the microsoft excel work sheet? By using the clipboard function, I can read the...
6
by: McKirahan | last post by:
I an using ASP to read a database table and generate an HTML table which is save via FSO with a file extension of .xls which opens up in MS-Excel. I am inserting several lines of text into a cell...
0
by: NDK | last post by:
Ok so I have an html page with an embedded excel object. I load some information into the object from a spreadsheet. (works perfectly) I would like to be able to change the background of a few...
3
by: Blasting Cap | last post by:
I have an app that gives a user an option to pull an online report into Excel. I have the rows formatted in a couple different colors, with a grey header & footer. No matter what colors the...
2
by: John Bartley K7AAY | last post by:
When I output a table's values to XLS, one value in a very small table, and only one value, is changed. Here are the values in the table, tblLevel. LEVEL H-14 0 1 1.1
6
by: slinky | last post by:
I found the following code to transfer datagrid data to an Excel file. Is this written in C#?... I'm a vb.netter. I'm just not sure where to place the code to experiment on it. Should I place it in...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.