Reporting Services PDF fails in Netscape -
09-22-2004
, 05:56 AM
(This is not strictly an OLAP issue, but I wanted to put it into a managed
group.)
I'm working on a ASP.NET/Reporting Services web app in which the user fills
in information, saves it to a DB, and retrieves a PDF by pressing a button.
It's basically a mailmerge using RS.
I'm using the RS web service and code to create and deliver the pdf.
The app delivers the PDF without a problem to IE. And the PDF works fine in
IE and Netscape when the user retrieves the report Using MS Report Manager.
But the PDF blows up with the user calls the report out of the app using
Netscape. It looks like this:
%PDF-1.3% 1 0 obj [/PDF /Text /ImageB /ImageC /ImageI] endobj 3 0 obj <<
/Type /Page /Parent 2 0 R /MediaBox [0 0 612.000071 792.000092] /Contents 4 0
R /Resources << /ProcSet 1 0 R /XObject << >> /Font << /F5 5 0 R /F6 6 0 R
/F7 7 0 R >> >> >> endobj 4 0 obj << /Length 1941 /Filter /FlateDecode >>
stream x……
and so on.
Here are the relevant parts of the code that builds and delivers the PDF:
Dim deviceInfo As String = "<DeviceInfo>" + _
"<Columns>1</Columns>" + _
"<Dpix>300</Dpix>" + _
"<Dpiy>300</Dpiy>" + _
"<EndPage>0</EndPage>" + _
"<PageWidth>8.5in</PageWidth>" + _
"<StartPage>0</StartPage>" + _
"</DeviceInfo>"
....
dim mimeType As String = "application/pdf"
Dim sh As localhost.SessionHeader = New localhost.SessionHeader
...
report = rs.Render(reportPath, format, historyId, deviceInfo, parameters,
credentials, _
showHideToggle, encoding, mimeType, reportHistoryParameters, warnings,
streamIDs)
sh.SessionId = rs.SessionHeaderValue.SessionId
Response.Clear()
' Set the HTTP headers for a PDF response.
HttpContext.Current.Response.ClearHeaders()
HttpContext.Current.Response.ClearContent()
HttpContext.Current.Response.ContentType = "text/html"
HttpContext.Current.Response.AppendHeader("Content -Disposition",
"filename=""FinancialReport.pdf""")
httpContext.Current.Response.BinaryWrite(report)
HttpContext.Current.Response.End() |