RE: Asp.Net : html to excel problem

From: Spacy (nseena(!!!remove!!!)_at_hotmail.com)
Date: 10/23/04


Date: Sat, 23 Oct 2004 03:17:03 -0700


Finally I got atleast some headaway with this awful problem!
I found that this problem of the new html report not being displayed
after saving the first report to excel, occurs on only certain clients.
I was testing the code on the web server, and it wasnt working.
But on some clients, IT WORKS PERFECTLY!!!!!!!!!!

Anyone knows why????

Thanks in advance.

Regards,
Spacy

"Spacy" wrote:

>
> Hi Henrik!
>
> Thanks for the prompt reply! I tried using response.flush() and
> response.close(), but the same problem persists. Let me explain what am doing:
>
> I have 2 hyperlinks. On the click of first hyperlink, ExcelReport.aspx is
> executed which contains the code:
> > Response.ContentType = "application/vnd.ms-excel"
> > > Response.AddHeader("content-disposition", "attachment; filename=Report.xls")
> After this code, i write all the response.write statements that generates
> the html table. The Excel Report is saved perfectly. The page does not output
> anything on the screen. No problem till here!
>
> Now when i click on the second link, Report2.aspx is called which contains
> code to generate the second html table and output it on the screen. In debug
> mode, every line of code is executed. But the screen is blank. The new html
> table is not displayed.
>
> I know that probably am missing something silly. Could you please help ????
>
> Cheers..
> Spacy
>
>
>
> "Henrik Nordgren" wrote:
>
> > Hi Spacy!
> >
> > You should check the execution path of your program to find out what happens
> > at the second postback. All the data you write to the response stream after
> > the;
> >
> > Response.ContentType = "application/vnd.ms-excel"
> > Response.AddHeader("content-disposition", "attachment; filename=Report.xls")
> >
> > ...lines are streamed to that excel file. That is the key to get the correct
> > output.
> >
> > Please step through the code to really find out what is happeneing, and
> > verify that you are writng the correct info from the datasource during ALL
> > of the postbacks, not only the first one.
> >
> > And remeber
> >
> > Response.Flush();
> > Response.Close();
> >
> > when you are done writing the excel file!!
> >
> > kind regards
> > Henrik
> >
> > "Spacy" wrote:
> >
> > >
> > > Am creating a HTML Report in asp.net. To save this report to excel on
> > > client-side, i write this code:
> > > Response.ContentType = "application/vnd.ms-excel"
> > > Response.AddHeader("content-disposition", "attachment; filename=Report.xls")
> > >
> > > But once the report is saved in excel, on click of hyperlink for second html
> > > report, i dont get the second report. the same old first html report is
> > > displayed.
> > >
> > > Please can anyone help me. Am frustrated with this! Is it a problem of data
> > > being cached? PLease help. Its very urgent!!!
> > >
> > > Regards,
> > > Spacy
> > >
> > >
> > >
> > >



Relevant Pages

  • Re: Best Way to Export Web Data to Excel or Word
    ... HTML format and then send that to the client, directing it Word or Excel as ... version of the report and I haven't been able to figure out how to do that. ... Word/Excel XML file formats. ...
    (microsoft.public.office.developer.vba)
  • Re: Got Alemon Trojan... deleted but cant change wallpaper
    ... | wallpaper to an .html file. ... It is suggested that you execute the following tool in both Normal Mode and then in Safe ... On Win9x/ME platforms the report will not be shown in your bowser ... It would be best to scan in both Safe Mode and in Normal Mode and save a copy of the HTML ...
    (microsoft.public.windowsxp.help_and_support)
  • RE: Automatically E-mail Reports
    ... I don't know anything about eReports. ... If you want to create HTML output from a report in VFP you can use GenHTML ... LOCAL lnResult, oHTML ...
    (microsoft.public.fox.programmer.exchange)
  • RE: Using Access on Company Intranet
    ... several years ago I made an Access report that produced html. ... html codes in your report (don't forget all the starting code that starts up ... Good luck Brent. ...
    (microsoft.public.word.docmanagement)
  • Re: Excel for presenting Access Data
    ... If you have output in Excel that is vaguely similar I think you should feel ... report and query the database from Excel, making your report in Excel also. ... I selected HTML Pages ... I guess the question is what is HTML seeing that is causing the formatting ...
    (microsoft.public.excel.programming)