Page 1 of 1
Export HTML File Per Page
Posted: Mon Nov 04, 2019 1:14 pm
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?
Re: Export HTML File Per Page
Posted: Tue Nov 05, 2019 7:23 am
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.
Re: Export HTML File Per Page
Posted: Tue Nov 05, 2019 12:01 pm
by tims
What would the code look like to do that in the Exporting event?
Re: Export HTML File Per Page
Posted: Wed Nov 06, 2019 8:42 am
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.
Re: Export HTML File Per Page
Posted: Wed Nov 06, 2019 12:02 pm
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.
Re: Export HTML File Per Page
Posted: Thu Nov 07, 2019 9:52 pm
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.
Re: Export HTML File Per Page
Posted: Wed Nov 13, 2019 4:41 pm
by tims
Is there any way to do it in the report?
Re: Export HTML File Per Page
Posted: Fri Nov 15, 2019 11:06 pm
by Lech Kulikowski
Hello,
Unfortunately, no.
Thank you.