Export as Svg file (first page only)

Stimulsoft Ultimate discussion
Post Reply
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Export as Svg file (first page only)

Post by bobsov »

My goal is to save the report as svg file so that I can use this as a thumbnail view in another part of application. I have a choice of using jpg but i want to use svg. Everytime I export to svg file, there is 0 bytes in there and it does not open at all.


Here is my code so far.
report.ExportDocument(StiExportFormat.ImageSvg,filename + ".svg");


How can I correctly export just first page to svg file from code behind? Please help.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Export as Svg file (first page only)

Post by bobsov »

This is done right after .mrt file is created. So not sure if that information matters.

Full code:

protected void StiWebDesigner1_SaveReport(object sender, StiWebDesigner.StiSaveReportEventArgs e)
{
StiReport report = e.Report;
string filename = Server.MapPath("/reports/repository/" + id);
report.Save(filename + ".mrt");
report.ExportDocument(StiExportFormat.ImageSvg,filename + ".svg");
}
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Export as Svg file (first page only)

Post by Alex K. »

Hello,

Please try to use the following code:

Code: Select all

...
report.Load();
report.Render();
report.ExportDocument(...);
Thank you.
bobsov
Posts: 115
Joined: Sun Jan 27, 2013 12:10 am

Re: Export as Svg file (first page only)

Post by bobsov »

Thanks Aleksey. Worked like a charm. Cheers!!!
Alex K.
Posts: 6488
Joined: Thu Jul 29, 2010 2:37 am

Re: Export as Svg file (first page only)

Post by Alex K. »

Hello,

We are always glad to help you!

Thank you.
Post Reply