Page 1 of 1

get export output as byte stream

Posted: Fri Feb 18, 2011 7:40 am
by tobi
Is it possible to get the exported report data (pdf, jpg, ...) as bytestream without saving it to disk before ?

get export output as byte stream

Posted: Fri Feb 18, 2011 1:01 pm
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.