Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outputing a PDF file and updating the web page at the same time

Status
Not open for further replies.

jjwild

Programmer
Sep 7, 2001
115
US
I am using Response.BinaryWrite to export a PDF to my web page. This works fine - when the code behind is finished I am prompted to Open or Save the PDF file.

However, this process is triggered by clicking a "Run Report" button on the web page and as part of running the report and exporting it to PDF, I need to update the web page. This is not happening. It appears that once I do Response.BinaryWrite, any changes to the controls on the web page itself are ignored.

Does anyone know a way around this?

Thanks,

John
 
yes, if your diasplaying a pdf, then there is not a page to render. you may want to open the pdf in a seperate window and have the page refresh with updated values.
Or have the page refresh and display a link to pdf file. when the user clicks on the pdf link, stream the contents to the client.

I find the ashx (web handlers) are better suited for streaming files rather than using a aspx (web form). search tek-tips or google for more examples.

Jason Meckley
Programmer
Specialty Bakers, Inc.
 
Thanks for the post.

I didn't want to have the users have to click a link, so I tried the separate page. This worked fine except if the user clicks Cancel, they are left with a blank web page that they have to separately close.

It there any way in the code behind to force the page to refresh in addition to doing the BinaryWrite?

Thanks,

John

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top