Page 1 of 1

Report Generation

Posted: Fri Apr 16, 2010 9:56 pm
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

Report Generation

Posted: Sat Apr 17, 2010 12:20 am
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.