Report Generation

Stimulsoft Reports.NET discussion
Post Reply
vijendra
Posts: 26
Joined: Fri Apr 18, 2008 9:11 am
Location: Udaipur

Report Generation

Post by vijendra »

Hi,
I want to generate a password protected report on a button click.I have used the following code for this:

StiReport report = new StiReport();
report.Load("report.mrt");
report.RegData("MyTable", table);

StiPdfExportSettings settings = new StiPdfExportSettings();
settings.PasswordInputOwner = "1";
settings.PasswordInputUser = "2";

report.ExportDocument(StiExportFormat.Pdf, "file.pdf", settings);

But the code simply gets executed and nothing is shown.I cant see the generated report.I want that the user should be prompted for save location,name the report and finally save it in pdf format.
Pls let me know what i m missing?
Regards
Bharat
Jan
Posts: 1265
Joined: Thu Feb 19, 2009 8:19 am

Report Generation

Post by Jan »

Hello Brahat,

If you use asp.net you can use following line of code in PageLoad event:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(webPage, report, true);
if you want do this in WinForms then you need use standard WinForms file dialog for creating file name. After then you can provide this file name to ExportDocument method.

Thank you.
Post Reply