Get back to web form from a Response.ContentType = "application/pdf"

Hi,

My last page of my ecommerce site, called Confirmation.aspx, has one button which allows user to print an order confirmation. I am exporting a report as a pdf file. My code brings up the adobe acrobat into the browser. The user prints out the order confirmation. How do I get back to the web page , Confirmation.aspx? When I hit the Back button on the browser, it goes back to far. Is there a way to call adobe acrobat separate from the browser?
Below is my subroutine.
Thanks,
poc1010
Public Function ReportPDF(ByVal myreport As CrystalReport1)
Dim myExportOptions As ExportOptions
Dim myDiskFileDestinationOptions As New DiskFileDestinationOptions()
Dim myExportFile As String
myExportFile = "C:\Temp " & Session.SessionID.ToString & ".pdf"
myDiskFileDestinationOptions.DiskFileName = myExportFile
myExportOptions = myreport.ExportOptions
With myExportOptions
.DestinationOptions = myDiskFileDestinationOptions
.ExportDestinationType = ExportDestinationType.DiskFile
.ExportFormatType = .ExportFormatType.PortableDocFormat
End With
myreport.Export()
Response.ClearContent()
Response.ClearHeaders()
Response.ContentType = "application/pdf"
Response.WriteFile(myExportFile)
Response.Flush()
Response.Close()
System.IO.File.Delete(myExportFile)
End Function
0
poc1010
3/1/2004 8:17:32 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

3 Replies
914 Views

Similar Articles

[PageSpeed] 32

It all depends on the client for that.

If they open pdf by default in the browser or not.
I believe you could force the download box to come op though, but if they click Open on that it still opens in the browser I thought?
Is this a solution:
Popup a new window, open the pdf in there, when the user has printed it, he just closes that window.
0
CumpsD
3/1/2004 8:38:16 PM
CumpsD,

I guess you are talking about JavaScript which I do not know well. Should I convert the code I have in my sub routine to javaScript. The code should be very close to what I have in this sub routine. Can you give me an example based on my subroutine from first posting.
Thanks,
poc1010
0
poc1010
3/1/2004 9:00:42 PM
Well, my idea would to create a page called

SendPDF.aspx
Wich only includes your sub to send your pdf to the client (like you have now)
and then on your original site you have a link or a button with window.open() to open your new aspx page in a new window.
0
CumpsD
3/1/2004 9:27:10 PM
Reply:

Similar Artilces:

Multiple "Forms" in a Web Form.
Hi, this query relates to ASP.NET 2.0. I use C# but answers in C# or VB.Net is fine. I have a form to capture a person's details. The form is the usual forename, surname, etc. and the Person is held in a Person Class. What I want to be able to do is to move the form creation into a Class in a separate Class in App_Code. This will enable a button to be placed on the web form to "Add Another Person" using the class. This would create a new Person object and write a new form into the page for the second person to fill in their details. Naturally, this could continue to n Pe...

superreview denied: [Bug 410500] Add "Web form password" description to web form keychain items : [Attachment 295140] fix
Mark Mentovai <mark@moxienet.com> has denied Stuart Morgan <stuart.morgan@alumni.case.edu>'s request for superreview: Bug 410500: Add "Web form password" description to web form keychain items https://bugzilla.mozilla.org/show_bug.cgi?id=410500 Attachment 295140: fix https://bugzilla.mozilla.org/attachment.cgi?id=295140&action=edit ------- Additional Comments from Mark Mentovai <mark@moxienet.com> Not localizable :( ...

superreview requested: [Bug 410500] Add "Web form password" description to web form keychain items : [Attachment 295140] fix
Stuart Morgan <stuart.morgan@alumni.case.edu> has asked Mark Mentovai <mark@moxienet.com> for superreview: Bug 410500: Add "Web form password" description to web form keychain items https://bugzilla.mozilla.org/show_bug.cgi?id=410500 Attachment 295140: fix https://bugzilla.mozilla.org/attachment.cgi?id=295140&action=edit ...

Create web form with Web Matrix "error"
I have created the web form (Filterd Data Report) with Web Matrix, but when I run the following error: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30289: Statement cannot appear within a method body. End of method assumed.Source Error: Line 62: Sub DataGrid1_SelectedIndexChanged(sender As Object, e As EventArgs) Line 63: Line 64: Function MyQueryMethod(ByVal empno As...

Is "Session" the best solution for transfering variables between "Web Forms"??
Hi all; I am using an ASP.NET Web Application (with VB.NET)... and this App used to manage customers' requests.. so, ther user will handel customer#1 data for a while, then he (the user) will handle the data of customer#2. and so on.. And I need to transfer some variables value from one page (Web Form) to onother pages (Web Forms), Is the "Session" variable the BEST solution? and do you recommend me to increase its live to 60 mins or more. (In case the user need approx. 1 hour to handle customer#1 data!!)?? Example of values I want to transfer: CustomerID, RequestNo, Co...

Sharepoint help! Error msg : "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"
hihi, I have set up a testing virtual server on my local machine. I installed win server 2003, wss 2.0, sql server 2000, and visual studio .net 2003. i tried to create a project in C# but when i build it and import the web part (.dwp) into the page, there is this error msg "A Web Part or Web Form Control on this Web Part Page cannot be displayed or imported because it is not registered on this site as safe"  I seached most of the sites and they informed that the problem lies in the safe control in web.config i enter the safe control in web.config but i does not know where to put ...

Could not create web application .. there is no web at ""
I figured out I skipped a step in the login tutorial,  This involves installing an application in the local IIS.  When I attempt to add a web application to the file system it gives me the following error. "Cannot create web at HTTP".... you are not authorized" It the web application important in this porcess? If so how can I get my IIS to accept the Web Application so I can built a login page I am the administrator of the server  Open the IIS manager and add an application for the target site. Then try again!When you ask a question, remember to click &...

Changing "Web Form Designer Generated Code" and it Changes back!
I created a SQL connection using VS.net's built in tools for doing so. I'm calling a stored procedure to which I am trying to pass a variable (the contents of a querystring). I have the code for this written in the SQLSelectCommand1 area, but the problem is vs.net keeps changing the code back to the way it wrote it. My way works, VS doesn't, so I have to keep pasting my code changes back to the .vb file. Is there any way to make these changes stick?...

2 script tags, Script Language="javascript" and Script runat="server" in a web form.
Where should i place the javascript portion in the webform if i already had my <script runat="server"> (VB) place afterthat? Mark up: i understand that it should have 2 script tags used in the web form.  <SCRIPT LANGUAGE="JavaScript"> var isNN = (navigator.appName.indexOf("Netscape")!=-1); ...etc</script> <script runat="server">     Dim x, iRow, iCol, noRec As Integer   Dim i As Integer ... etc. <script> <asp:Content ID="First" ContentPlaceHolderID="aad"...

How to preserve the value of a form field when the user press a "BACK" button on my web page?
Hi all,  I have 3 forms with some text fields and checkboxes. I move from Form1 to Form2, and then to Form3. I use session variables to pass values between forms. Now the problem is, when I am in Form3, when the user clicks a "BACK" button on Form3, he should be taken to Form2. At this stage, the data he entered on Form2 should be there as it was! For this, should I load back the values of each field from the session variables? Or is there any automated method to do this (may be from the viewstate etc.)? Can anyone help me? Thanking you in advance, Tomy Viewstate works onl...

A "Web Application Project" for web-services ?
I was wondering if there is something analogous to the "Web Application Project" VS add-in for Web-services. By analogous I mean: 1. All the source files in a Web-services project is compiled into a single assembly, perhaps with the exceptions of the .asmx file 2. Property pages for the project in VS display all the tabs that are available in other kinds of projects - i.e., for example, ability to specify pre and post build events, the XML documentation file etc. I really appreciate any help. Cheers, Adrigo Yes, the current release supports creating an "ASP.Net Web Service Applica...

Why don't I see the "use master page" check box when I add a new web form to my web app?
From what I've read I should see this check box whenever I add a new web form but I don't.  Should I add something else instead of a web form or is there a flaw in my web apps install? Woot! I found the answer!  There is an item in the add new item dialog box called web content form! If you use this instead of the web form then all is good and warm fuzzy!...

VS.NET 2005 is ignoring in web.config strict="true". I get no error when I try this: Dim x As Integer = "string"
Hello,I have this in my VS.NET 2005 web.config <compilation debug="true" strict="true" explicit="true">When I do this in my vb code:Dim x As Integer = "string"I get no error. When I hit compilation I also get no error. What am I doing wrong?Thanks for helping!Regards,J. Bauer It's a bug of some sort See this response by Scott Guthriehttp://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3c1c9898-8076-4f69-a5e2-e99573d03c6e Unfortunately we don’t have a GUI based way to configure this. L It is something we will make sure gets added back in, though, with the next...

How to connect PB .NET Web Forms to MS SQL 2005 via SNC using "Windows Authentication"?
Dear All, I have a PowerBuilder native client / server application which connects fine to the Microsoft SQL Server 2005 back-end database via the SNC native driver using "Windows Authentication" (NOT "SQL Server Authentication"). The corresponding program code being used is as shown below: ///////////////////////////////////////////////////////////////////////////////////////////////////////// String ls_userid, ls_password ls_userid = sle_id.Text ls_password = sle_password.Text IF Len(ls_userid) <> 0 AND Len(ls_password) <> 0 THEN // Pro...

Web resources about - Get back to web form from a Response.ContentType = "application/pdf" - asp.net.web-forms

Resources last updated: 1/19/2016 7:51:35 AM