Response.ContentType and Viewstate problem

Discussion in 'ASP .Net' started by =?Utf-8?B?RXlhbCBaaW5kZXI=?=, Apr 22, 2004.

  1. 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.
    =?Utf-8?B?RXlhbCBaaW5kZXI=?=, Apr 22, 2004
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. alien2_51

    Response.ContentType

    alien2_51, Jun 26, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    751
    alien2_51
    Jun 26, 2003
  2. Bart Vanwesemael
    Replies:
    1
    Views:
    523
    William F. Robertson, Jr.
    Jul 28, 2003
  3. TJS
    Replies:
    5
    Views:
    1,055
    Alvin Bruney
    Nov 19, 2003
  4. David Lozzi
    Replies:
    5
    Views:
    12,428
    Matt Berther
    Jan 14, 2005
  5. Katie
    Replies:
    8
    Views:
    264
    Anthony Jones
    Aug 17, 2006
Loading...

Share This Page