Page 1 of 1

Export as Svg file (first page only)

Posted: Mon Mar 04, 2013 4:32 pm
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.

Re: Export as Svg file (first page only)

Posted: Mon Mar 04, 2013 4:43 pm
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");
}

Re: Export as Svg file (first page only)

Posted: Wed Mar 06, 2013 8:27 am
by Alex K.
Hello,

Please try to use the following code:

Code: Select all

...
report.Load();
report.Render();
report.ExportDocument(...);
Thank you.

Re: Export as Svg file (first page only)

Posted: Wed Mar 06, 2013 5:38 pm
by bobsov
Thanks Aleksey. Worked like a charm. Cheers!!!

Re: Export as Svg file (first page only)

Posted: Thu Mar 07, 2013 6:00 am
by Alex K.
Hello,

We are always glad to help you!

Thank you.