Separate HTML Pages

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

Separate HTML Pages

Post by tims »

When I export a report to HTML, how can I make each page a separate HTML File.

I see a property for doing something similar with Excel, but how can it be done with HTML?

Tim S.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Separate HTML Pages

Post by HighAley »

Hello, Tim.
tims wrote:When I export a report to HTML, how can I make each page a separate HTML File.

I see a property for doing something similar with Excel, but how can it be done with HTML?
You should export each page separately.

Code: Select all

Stimulsoft.Report.Export.StiHtmlExportSettings es = new Stimulsoft.Report.Export.StiHtmlExportSettings();
for (int index = 0; index < report.RenderedPages.Count; index++)
{
    string pageNumber = (index + 1).ToString();
    es.PageRange = new StiPagesRange(pageNumber);
    report.ExportDocument(StiExportFormat.Html, "d:\\ReportName_Page" + pageNumber + ".html", es);
}
Thank you.
tims
Posts: 41
Joined: Thu Mar 26, 2009 9:40 am
Location: Canada

Separate HTML Pages

Post by tims »

Where do I place that code? I'm using VB.net as the language.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Separate HTML Pages

Post by HighAley »

Hello.
tims wrote:Where do I place that code? I'm using VB.net as the language.
If you use VB.net then try next code:

Code: Select all

Dim es As New Stimulsoft.Report.Export.StiHtmlExportSettings()
For index As Integer = 0 To report.RenderedPages.Count - 1
	Dim pageNumber As String = (index + 1).ToString()
	es.PageRange = New StiPagesRange(pageNumber)
	report.ExportDocument(StiExportFormat.Html, "d:\ReportName_Page" & pageNumber & ".html", es)
Next
Thank you.
tims
Posts: 41
Joined: Thu Mar 26, 2009 9:40 am
Location: Canada

Separate HTML Pages

Post by tims »

Where do I place that code?

I receive errors when I add it in.
http://screencast.com/t/A2RHEn3N
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Separate HTML Pages

Post by HighAley »

Hello.
tims wrote:Where do I place that code?

I receive errors when I add it in.
http://screencast.com/t/A2RHEn3N
You should put it in your project.

Thank you.
Post Reply