Hello,
A customer of ours has been using a .NET aspx page in IIS for several years now, which does the following :
- Log on to a BO XI R3.1 server
- Find the mentioned report
- Perform a refresh (with the eventual prompts filled out)
- Stream the result as a PDF to the browser
Basically, this RunWebReport aspx can be called as follows :
http://myserver/RunWebReport/default.aspx?FileName=MyReportName
We recently installed a new BO XI R3.1 SP7 server on a Windows Server 2012 R2 machine,
and since that moment, we have an issue with the PDF stream.
We tried different browsers (IExplorer, FireFox, Chrome, all different versions) and different PDF plugins (Adobe, FoxIt, PDFViewer).
They all give back the same type of errors :
- Failed to load PDF document
- File does not begin with '%PDF-'
- The PDF document might not be correctly displayed
In some cases, you can then download the stream to an actual local PDF file, but when opening this file with Acrobat, you get the error that the file might be damaged.
So, it seems the stream is recognized as a PDF allright, but the content does not seem to be ok.
When downloading the "corrupt" PDF, I see that the size is much smaller than it normally should be.
When we open the same report in a InfoView session, and download it as a PDF manually, this works fine.
The application runs through all the steps just fine, and does not generate any error.
It's just that the stream is not ok in the end.
Here's the function which finally streams to the browser.
Does anyone see something which might be missing here ?
Or could it be an IIS 8 issue ?
Thanks !
Bruno.
Private Function VisualizeReport(ByRef MyDocView As IBinaryView, _ ByRef MyDoc As IDocumentInstance) As Boolean Dim gLog As ILog = log4net.LogManager.GetLogger("VisualizeReport") VisualizeReport = False Try MyDocView = MyDoc.GetView(OutputFormatType.Pdf) gLog.Debug("DocView set ...") Response.ClearContent() Response.ClearHeaders() Response.ContentType = "application/pdf" Response.AddHeader("Content-Type", "application/pdf") Response.AddHeader("Content-Length", MyDocView.ContentLength.ToString) Response.Expires = 0 MyDocView.WriteContent(Response.OutputStream) Response.Flush() Response.Close() gLog.Debug("OutputStream written ...") VisualizeReport = True Catch ex As Exception gLog.Error("Error during report visualization : " + ex.Message) VisualizeReport = False End Try End Function