Show PDF in new window

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

With code behind I create a PDF-report and show it.

System.IO.MemoryStream ReportStream
= (System.IO.MemoryStream)crReportDocument.ExportToStream(ExportFormatType.PortableDocFormat);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.BinaryWrite(ReportStream.ToArray());
Response.End();

The PDF is shown in the same window. How can I show the PDF in a new window?

Thanks in advance.
 
If the aspx page sending the PDF is accessed using an anchor tag, then
giving target='_blank' for that tag would open in new window.

With code behind I create a PDF-report and show it.

System.IO.MemoryStream ReportStream
=
(System.IO.MemoryStream)crReportDocument.ExportToStream(ExportFormatType.Por
tableDocFormat);
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
Response.BinaryWrite(ReportStream.ToArray());
Response.End();

The PDF is shown in the same window. How can I show the PDF in a new window?

Thanks in advance.
 
Back
Top