Stream in a new window

  • Thread starter Thread starter Guest
  • Start date Start date
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.
 
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
 
Back
Top