You should use path, instead of stream.
Example with path:
using (FastReport.Report report = new FastReport.Report())
{
report.Load(@"C:\test.frx");
report.Prepare();
report.Export(new FastReport.Export.Image.ImageExport(), "myReport.png");
}
When report has more than one page, the following files will be created:
myReport.png
myReport.2.png
myReport.3.png
...
Here is solution with stream. You should set PageRange = PageRange.Current
and set CurPage
to appropriate value:
int count = 1;
using (FastReport.Report report = new FastReport.Report())
{
report.Load(@"C:\test.frx");
report.Prepare();
foreach (PageBase item in report.Pages)
{
string fileName = string.Format("myReport_{0}.png", count);
report.Export(new FastReport.Export.Image.ImageExport() { PageRange = PageRange.Current, CurPage = count }, fileName);
count++;
}
}