G
Guest
I’m attempting to stream a PDF to the browser so that the user will get the
appearance of just opening the PDF in Explorer. The PDF is being generated by
the SQL Server Reporting Services web service as a byte array (I’ve already
checked that this is working as expected).
My problem is that Explorer just loads a blank page, and reports “Done†in
the status bar. If I hit Refresh, it prompts me to “resend the informationâ€,
on clicking Retry, IE loads the PDF successfully. If instead of Refresh, I
click in the Address bar and hit Enter, the PDF loads successfully without
prompting.
How can I get this to work properly (i.e. without needing to reload the page)?
I’ve tried various alternatives without success, PLEASE HELP!
I’m currently using the following code (where pdfReport.RenderedReport is a
property returning the byte array):
Response.Clear()
Response.ContentType = "application/pdf"
Response.AddHeader("content-length", _
pdfReport.RenderedReport.Length.ToString)
Response.OutputStream.Write(pdfReport.RenderedReport, 0, _
pdfReport.RenderedReport.Length)
Response.Flush()
Many thanks in advance,
Rob
appearance of just opening the PDF in Explorer. The PDF is being generated by
the SQL Server Reporting Services web service as a byte array (I’ve already
checked that this is working as expected).
My problem is that Explorer just loads a blank page, and reports “Done†in
the status bar. If I hit Refresh, it prompts me to “resend the informationâ€,
on clicking Retry, IE loads the PDF successfully. If instead of Refresh, I
click in the Address bar and hit Enter, the PDF loads successfully without
prompting.
How can I get this to work properly (i.e. without needing to reload the page)?
I’ve tried various alternatives without success, PLEASE HELP!
I’m currently using the following code (where pdfReport.RenderedReport is a
property returning the byte array):
Response.Clear()
Response.ContentType = "application/pdf"
Response.AddHeader("content-length", _
pdfReport.RenderedReport.Length.ToString)
Response.OutputStream.Write(pdfReport.RenderedReport, 0, _
pdfReport.RenderedReport.Length)
Response.Flush()
Many thanks in advance,
Rob