Response.ContentType and Viewstate problem

G

Guest

Hello to all..

I'm trying to format an excel page by creating html tables on the fly through Response.ContentType = "application/vnd.ms-excel" .
I now produce reports in html format by processing xsl templates and datasets and I would like to re-use the same xsl templates to produce excel content and display it in the browser.

Here is the problem I run into:
When I return a small enogh dataset (about 10 lines by 5 columns), the excel program has no problems processing the html table format. But when the dataset becomes slightly bigger ( 30+ lines or so.. ), the excel sheet can not process the table and IE asks me to save or open the file.

I noticed then that ViewState may play a big roll in that process, since the more data is stored in ViewState the more lines Excel has to go through before finding the appropriate html table.. However, if I disable ViewState (for the page or for the lable control), I end up with gyborish all over.. excel simply hangs for 3 min. before displaying a list of garbege

I also tryed to do a Response.Write .. (instead of asigning the string to a designated lable control) ..
Same problem!

A few notes to consider:
1. the page I display the html on, has only one table - no other text.
2. the data is saved into a session variable from another page before being recalled (by session variable) in this page, which is designated for displaying only the html table
3. the string is asigned to the lable control like so: lblExcel.Text = Session("exceldata"); ..

If anyone can help me with that, I would much apriciate it! ..
Thank you in advance for all your contributions.

- Eyal Z.
 

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

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top