Stream in a new window

G

Guest

Hi,

I use a Crystal Report Viewer to export a report in PDF. This is done by a
code behind procedure like this:
private void ExportReport()
{
MemoryStream oStream = new MemoryStream() ;
oStream = (MemoryStream)
currentReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
}

This work well and open a Acrobat reader into IE.

What I want is that the report in PDF format appear into a new window. It
seem to be impossible to communicatate between a window opened from client
side
by JavaScript and a stream generated form code behind.

Any suggestions are welcome.
 
H

Hans Kesting

Hi,
I use a Crystal Report Viewer to export a report in PDF. This is done by a
code behind procedure like this:
private void ExportReport()
{
MemoryStream oStream = new MemoryStream() ;
oStream = (MemoryStream)
currentReport.ExportToStream(CrystalDecisions.Shared.ExportFormatType.PortableDocFormat);
Response.Clear();
Response.Buffer = true;
Response.ContentType = "application/pdf";
Response.BinaryWrite(oStream.ToArray());
Response.End();
}

This work well and open a Acrobat reader into IE.

What I want is that the report in PDF format appear into a new window. It
seem to be impossible to communicatate between a window opened from client
side
by JavaScript and a stream generated form code behind.

Any suggestions are welcome.

You can't just direct a stream to a "different window", the server
doesn't have any concept of "client window", just of "someone"
requesting some stream.

The solution: have the popup-window request that PDF. Open that window
with a specific URL that will request your PDF, then the response will
end up in that window.

Hans Kesting
 

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

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top