I am not sure if this is a known problem or not, but if I do a pdf export it exports to a file fine. But if I stream it out it just opens a blank browser window and nothing shows up. It is an empty source. This is the code I am using: (I got from your sample..) ' Tell the browser this is a PDF document so it will use an appropriate viewer. ' If the report has been exported in a different format, the content-type will ' need to be changed as noted in the following table: ' ExportType ContentType ' PDF "application/pdf" (needs to be in lowercase) ' RTF "application/rtf" ' TIFF "image/tiff" (will open in separate viewer instead of browser) ' HTML "message/rfc822" (only applies to compressed HTML pages that includes images) ' Excel "application/vnd.ms-excel" ' Excel "application/excel" (either of these types should work. ' Text "text/plain" Response.Clear() Response.ClearHeaders() Response.ClearContent() Response.ContentType = "application/pdf" ' IE & Acrobat seam to require "content-disposition" header being in the response. If you don't add it, the doc still works most of the time, but not always. 'this makes a new window appear: Response.AddHeader("content-disposition","attachment; filename=MyPDF.PDF"); Response.AddHeader( "content-disposition", "inline; filename=MyPDF.PDF" ) ' Create the PDF export object Dim pdf As New PdfExport ' Create a new memory stream that will hold the pdf output Dim memStream As New System.IO.MemoryStream() ' Export the report to PDF: pdf.Export(rpt.Document, memStream) pdf.Export(rpt.Document, "C:\Test\file.pdf" ) ' Write the PDF stream out Response.BinaryWrite(memStream.ToArray()) ' Send all buffered content to the client Response.End() The export to file works fine. Thanks, Cory Jorgensen Bitco Software
Thank you,
Cory Jorgensen Bitco Software
|