Export as jpeg

Stimulsoft Reports.NET discussion
Post Reply
andiruddha
Posts: 3
Joined: Tue May 15, 2012 2:46 am
Location: Pune, India

Export as jpeg

Post by andiruddha »

My report has multiple pages .
When I export it as JPEG or any image
Only first page is exported.

How can export all the pages
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Export as jpeg

Post by HighAley »

Hello.
andiruddha wrote:My report has multiple pages .
When I export it as JPEG or any image
Only first page is exported.

How can export all the pages
When you export report to JPEG file, each page exports in a separate file.
If the report is exported to a stream, all images are put in one stream. In this case you could export each page to the separate stream with next code:

Code: Select all

StiJpegExportSettings es = new StiJpegExportSettings();
for (int index = 0; index < report.RenderedPages.Count; index++)
{
    string pageNumber = (index + 1).ToString();
    es.PageRange = new StiPagesRange(pageNumber);
    MemoryStream ms = new MemoryStream();
    report.ExportDocument(StiExportFormat.ImageJpeg, ms, es);
}
Tahnk you.
Post Reply