how to export report to PDF, RTF, XLS and DOC

Stimulsoft Reports.NET discussion
Post Reply
sunsity4ever
Posts: 2
Joined: Wed Sep 17, 2008 7:44 am
Location: India

how to export report to PDF, RTF, XLS and DOC

Post by sunsity4ever »

I'm developing an WCF application and using Stimulsoft for reporting.
I used to generate report at runtime at client side.
My query is - I want to have facility to export report to any of these file types PDF, RTF, XLS and DOC. I want to achieve this through programmatically not just by the selecting from option given on report. What are the function available in stimulsoft class library, so that i write code which accepts requirement from client and export directly to these formats with/without showing actual report.

An early response will be highly appreciated.

Thanks & regards
Sanjay Malvi
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

how to export report to PDF, RTF, XLS and DOC

Post by Edward »

Hello, Sanjay Malvi.

Here is the code for exporting of the report without using dialog window:

Code: Select all

report.Render(false);
Stimulsoft.Report.Export.StiExcelExportService s = new
Stimulsoft.Report.Export.StiExcelExportService ();
StiExcelExportSettings mySettings = new StiExcelExportSettings();
FileStream fs = new FileStream("MyFile.xls",FileMode.Create,FileAccess.ReadWrite);
s.ExportExcel(report,fs,mySettings);
fs.Close();
And there are classes for exporting into each type of formats:
StiPdfExportService
StiRtfExportService
StiWord2007ExportService

mySettings is intended for specifying of the required parameters.

Thank you.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

how to export report to PDF, RTF, XLS and DOC

Post by Vital »

Hello,

Also you can use method ExportDocument of StiReport.

Thank you.
Post Reply