Re: New browser window
From: Craig Deelsnyder (cdeelsny_at_NO_SPAM_4_MEyahoo.com)
Date: 07/23/04
- Next message: Bryant Hankins: "Re: PreCompile Confusion"
- Previous message: Steve C. Orr [MVP, MCSD]: "Re: How to get user's full name using HttpContext.Current.User"
- In reply to: tma: "New browser window"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Jul 2004 17:22:32 -0500
On 7/23/2004 5:14 PM, tma wrote:
> 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.
-- Craig Deelsnyder Microsoft MVP - ASP/ASP.NET
- Next message: Bryant Hankins: "Re: PreCompile Confusion"
- Previous message: Steve C. Orr [MVP, MCSD]: "Re: How to get user's full name using HttpContext.Current.User"
- In reply to: tma: "New browser window"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|