Export HTML File Per Page

Stimulsoft Reports.NET discussion
Post Reply
tims
Posts: 41
Joined: Thu Mar 26, 2009 9:40 am
Location: Canada

Export HTML File Per Page

Post by tims »

Is there a way that I can have separate HTML files generated for each page of a report when using the Save>HTML function from the report viewer instead of 1 html file with all the pages?
Lech Kulikowski
Posts: 7345
Joined: Tue Mar 20, 2018 5:34 am

Re: Export HTML File Per Page

Post by Lech Kulikowski »

Hello,

Unfortunately, direct;y in the viewer, designer it is not possible.
You can use code to export by pages in your code or use OnProcessExport event of the viewer.

Thank you.
tims
Posts: 41
Joined: Thu Mar 26, 2009 9:40 am
Location: Canada

Re: Export HTML File Per Page

Post by tims »

What would the code look like to do that in the Exporting event?
Lech Kulikowski
Posts: 7345
Joined: Tue Mar 20, 2018 5:34 am

Re: Export HTML File Per Page

Post by Lech Kulikowski »

Hello,

Something like:

Code: Select all

report.Load();
report.Render(false);
for (int i = 0; i < report.RenderedPages.Count; i++)
{
    var exportSettings = new StiHtmlExportSettings();
    exportSettings.PageRange = new StiPagesRange(i);
    report.ExportDocument(StiExportFormat.Html, "filename", exportSettings);
}
Thank you.
tims
Posts: 41
Joined: Thu Mar 26, 2009 9:40 am
Location: Canada

Re: Export HTML File Per Page

Post by tims »

Thank You. I don't think I quite understand what I need to do with that code. When I try to use it in the Exporting Event, I get a number of errors.

Can you review the attached sample report and advise?

Thanks for your help.
Tim S.
Attachments
ExportReport.mrt
(4.13 KiB) Downloaded 152 times
Lech Kulikowski
Posts: 7345
Joined: Tue Mar 20, 2018 5:34 am

Re: Export HTML File Per Page

Post by Lech Kulikowski »

Hello,

The provided code not for using in the report. You can use it in your project for exporting reports.

Thank you.
tims
Posts: 41
Joined: Thu Mar 26, 2009 9:40 am
Location: Canada

Re: Export HTML File Per Page

Post by tims »

Is there any way to do it in the report?
Lech Kulikowski
Posts: 7345
Joined: Tue Mar 20, 2018 5:34 am

Re: Export HTML File Per Page

Post by Lech Kulikowski »

Hello,

Unfortunately, no.

Thank you.
Post Reply