New browser window

T

tma

First, I'm following instructions without truly understanding them, so go
easy on me... :)

I am exporting a report to .PDF. Below is a code snippet. What I would like
is for a new IE instance to be launched with the .pdf instead of the current
IE window/aspx page. (My real problem is the window with which I am viewing
the pdf does not go back to the page that launched the export but rather the
page prior to it!) What do I need to change below to accomplish this?


crReport.Export()

Response.ClearContent()

Response.ClearHeaders()

Response.ContentType = "application/pdf"

Response.WriteFile(Fname)

Response.Flush()

Response.Close()


Thanks!
 
C

Craig Deelsnyder

First, I'm following instructions without truly understanding them, so go
easy on me... :)

I am exporting a report to .PDF. Below is a code snippet. What I would like
is for a new IE instance to be launched with the .pdf instead of the current
IE window/aspx page. (My real problem is the window with which I am viewing
the pdf does not go back to the page that launched the export but rather the
page prior to it!) What do I need to change below to accomplish this?


crReport.Export()

Response.ClearContent()

Response.ClearHeaders()

Response.ContentType = "application/pdf"

Response.WriteFile(Fname)

Response.Flush()

Response.Close()


Thanks!

Looks like you have the pdf in a file at some point? And I assume you
are showing us part of a script, just before this you exported the
file....Just open a popup window via Javascript pointing at the url of
the PDF document:

http://www.codeguru.com/Csharp/.NET/net_asp/scripting/article.php/c5337/

if you are storing the file outside of the webserver, then you would
want to popup a window pointed at an aspx page containing just the logic
above.

Note you can alternatively just put a link to the pdf with
target="_blank" if this export/view is a 2step process instead of all at
once.
 

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,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top