Show PDF in new window

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.
 
S

Shiva

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top