get export output as byte stream

Stimulsoft Reports.NET discussion
Post Reply
tobi
Posts: 9
Joined: Mon Jun 30, 2008 2:55 pm

get export output as byte stream

Post by tobi »

Is it possible to get the exported report data (pdf, jpg, ...) as bytestream without saving it to disk before ?
Ivan
Posts: 960
Joined: Thu Aug 10, 2006 1:37 am

get export output as byte stream

Post by Ivan »

Hello,

You can use the following code, for example:

Code: Select all

            StiReport report = new StiReport();
            MemoryStream ms = new MemoryStream();
            StiPdfExportService pdfService = new StiPdfExportService();
            pdfService.ExportPdf(report, ms);
            byte[] buf = ms.ToArray();
Thank you.
Post Reply