R
Rob
I have an ASP.Net web app that generates a Crystal Report in PDF format.
Since there is sensitive data within the reports, the pdfs need to be
streamed to the browser then deleted immediately. The report gets kick off
by a Java application redirecting the URL to the ASP.Net app on the IIS
Server with all report selection criteria appended to the querystring. The
Crystal Report is rendered in a new window.
In the Page_Load() event, I pull down all of the querystring parameter
values, use the values to query the database, return a dataset, generate a
Crystal Report in PDF Format, stream the PDF to the browser, then delete the
PDF. This works all fine and dandy, but the Page_Load() event gets executed
twice, so everything previously stated gets executed again. I am using IE
5.5. This issue is covered by Microsoft Article 307603.
http://support.microsoft.com/default.aspx?kbid=307603
What I was wondering is if any other developers have experienced this same
issue and what type of coding techniques were used to get around querying
the database twice and only streaming and deleting the PDF once?
If you have a PDF file, execute the following code below and put a
breakpoint in the code. You will see that this event is executed 2 or 3
times, depending on the version of your browser. No postbacks are made.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Query Database Code
...
'Generate Crystal Report in PDF Format
...
'Stream PDF to Browser
'Set the appropriate ContentType.
Response.ContentType = "Application/pdf"
'Get the physical path to the file.
Dim FilePath As String = MapPath("acrobat.pdf")
'Write the file directly to the HTTP output stream.
Response.WriteFile(FilePath)
Response.End()
End Sub
Any help or comments are appreciated.
Thanks,
Rob
Since there is sensitive data within the reports, the pdfs need to be
streamed to the browser then deleted immediately. The report gets kick off
by a Java application redirecting the URL to the ASP.Net app on the IIS
Server with all report selection criteria appended to the querystring. The
Crystal Report is rendered in a new window.
In the Page_Load() event, I pull down all of the querystring parameter
values, use the values to query the database, return a dataset, generate a
Crystal Report in PDF Format, stream the PDF to the browser, then delete the
PDF. This works all fine and dandy, but the Page_Load() event gets executed
twice, so everything previously stated gets executed again. I am using IE
5.5. This issue is covered by Microsoft Article 307603.
http://support.microsoft.com/default.aspx?kbid=307603
What I was wondering is if any other developers have experienced this same
issue and what type of coding techniques were used to get around querying
the database twice and only streaming and deleting the PDF once?
If you have a PDF file, execute the following code below and put a
breakpoint in the code. You will see that this event is executed 2 or 3
times, depending on the version of your browser. No postbacks are made.
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Query Database Code
...
'Generate Crystal Report in PDF Format
...
'Stream PDF to Browser
'Set the appropriate ContentType.
Response.ContentType = "Application/pdf"
'Get the physical path to the file.
Dim FilePath As String = MapPath("acrobat.pdf")
'Write the file directly to the HTTP output stream.
Response.WriteFile(FilePath)
Response.End()
End Sub
Any help or comments are appreciated.
Thanks,
Rob