Don't read the entire file into a byte array. Instead, process it in
manageable chunks, reading a smaller chunk of the file at a time.

Signature
HTH,
Kevin Spencer
Chicken Salad Surgeon
Microsoft MVP
> Hi,
>
[quoted text clipped - 15 lines]
>
> Manoj
Aryan - 23 Oct 2007 14:01 GMT
Keven, Thanks for prompt reply.
Here is the sample code snippet.
I am using SQLReport Server 2005 to get the data.
Byte[] results;
ReportExecutionService rsExec;
results = rsExec.Render(format, deviceInfo,
out extension, out encode,
out mimeType, out warnings, out streamIDs);
SavePDF(results, filename); // calling SavePDF method to save the
result array output in PDF form.
private bool SavePDF(Byte[] results, string fileName)
{
try
{
using (FileStream stream = File.OpenWrite(fileName))
{
stream.Write(results, 0, results.Length);
stream.Close();
stream.Dispose();
}
return true;
}
catch(Exception ex)
{
throw;
}
}
Now,
1> If I get large stream from ReportExecutionService then how to split
it in chunks and create a pdf file(say pdf has something around 3000 /
5000 pages in it)
Thanks in Advance.
Manoj