raj arokia

raj arokia

  • NA
  • 1
  • 0

How to export multiple report document to single pdf

Feb 11 2010 5:42 AM

I am trying to export different report documents to a single pdf . i did the below code but my pdf is getting overwritten with the latest report document.
inCode:
 i have exported the report document of type pdf  as bytes in memory stream array, and then storing the byte array to the pdf memory stream
 
byte[] byt;
MemoryStream[] outstr = new MemoryStream[reportDocument.Length];
MemoryStream pdf;

 
for
(i = 0; i < reportDocument.Length; i++)
{

outstr[i] = (
MemoryStream)reportDocument[i].ExportToStream(ExportFormatType.PortableDocFormat);
byt = outstr[i].ToArray();
pdf.Write(byt, 0, byt.Length);

}
Response.Clear();
Response.Buffer =
true;
Response.ContentType =
"application/pdf";
Response.BinaryWrite(pdf.ToArray());
Response.End();