Page 1 of 2

Reporting Architecture Issue

Posted: Wed Feb 25, 2009 10:42 am
by fkmfkm
Hi,

I could not find any documentation about this, so I post it here...

For eg. I have a aspx Purchase Order Entry. Upon completing the data entry on this page, the user wish to print this PO. Normally I will have print button on this page. Upon clicking it, an PDF will open up in a new browser showing this PO.

Where should I put this report in ? What would the code in the button look like ?

Thank you.

Reporting Architecture Issue

Posted: Thu Feb 26, 2009 7:00 am
by Edward
Hi

Please let us know your task in detail. Do you need to send parameters from the aspx page into the report and then to print it directly by pressing just a button on the client's computer?

Thank you.

Reporting Architecture Issue

Posted: Thu Feb 26, 2009 8:52 am
by fkmfkm
I already have all the data required on my data entry aspx page. I have it in my custom object. Some are single data like Creditors ID, Name, Address and the rest are repeating purchase detail items (Item ID, Description, Qty, Price).

So I need to pass all this data to my report and have the report appears as another web page (could be PDF, Word or HTML)

Reporting Architecture Issue

Posted: Thu Feb 26, 2009 9:17 am
by Edward
Please use the following code to export rendered report in Pdf:

report.ExportDocument(Stimulsoft.Report.StiExportFormat.Pdf, "D:\\MyFile.pdf");

To render report in pdf, please use the following:
Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report, false)

if you need a window with asking about saving the Pdf, please use the following command:

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report)

Thank you.

Reporting Architecture Issue

Posted: Fri Feb 27, 2009 10:52 am
by fkmfkm
I dont want the window asking to save the pdf ..

I want a new window showing the pdf ? how to do that ? Cause I want my original screen to remain.

Reporting Architecture Issue

Posted: Sun Mar 01, 2009 2:58 pm
by Jan
Hello,

At first you need add to your project new aspx page. This page will be used for showing report. After then type following code to redirect to page wich will be used to show report:

Code: Select all

report.Render();
string str = report.SaveDocumentToString();
string guid = Guid.NewGuid().ToString().Replace("-", "");

this.Page.Cache.Add(guid, str, null, Cache.NoAbsoluteExpiration, time, System.Web.Caching.CacheItemPriority.Low, null);

Response.Redirect(string.Format("WebForm2.aspx?report={0}", guid));
In PageLoad event of WebForm2 you need use following code:

Code: Select all

string guid = HttpContext.Current.Request.Params[“report”] as string;
if (guid == null)return;
string str = this.Page.Cache[guid] as string;
if (str == null)return;
StiReport report = new StiReport();
report.LoadDocumentFromString(str);
Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report);

Thank you.

Reporting Architecture Issue

Posted: Tue Mar 03, 2009 8:26 am
by fkmfkm
Hi,

It still prompts me the window to save the pdf...I wants it to open immediately in the acrobat reader while my aspx entry page still remain.


Reporting Architecture Issue

Posted: Tue Mar 03, 2009 12:33 pm
by Jan
Hello,

Please replace line of code:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report);
to:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report, false);
Thank you.

Reporting Architecture Issue

Posted: Wed Mar 04, 2009 4:46 am
by fkmfkm
Jan wrote:Hello,

Please replace line of code:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report);
to:

Code: Select all

Stimulsoft.Report.Web.StiReportResponse.ResponseAsPdf(this, report, false);
Thank you.
The problem is my original entry screen is gone...this way...what I left is the acrobat reader screen.

Reporting Architecture Issue

Posted: Thu Mar 05, 2009 2:38 pm
by Jan
Hello,

Sorry in some cases Acrobat Reader can't be opened in full page mode in browser.

Thank you.