Manipulate the datasource before show

Stimulsoft Reports.NET discussion
Post Reply
kevinxox
Posts: 1
Joined: Tue Jan 01, 2008 11:09 pm

Manipulate the datasource before show

Post by kevinxox »

Hi,

I'm planning to do a report. The report in some condition need to insert a new datarow manually. Currently, I will query the whole result from database to datatable in my program. Then add in new datarow into that datatable if needed. Last, pass the datatable to the report and show it. I would like to ask, is that able manipulate the datasource in report template? So that, the program will only call the report, and the report will grab the result directly from database and insert new datarow into it if meet the condition.
Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Manipulate the datasource before show

Post by Vital »

You can access to Data from databases (which report engine loads) with help of property CacheDataSet of report. For example:

Code: Select all

DataTable table = this.CacheDataSet["table1"];
You can change data in BeforePrintEvent of first page of your report.

Thank you.
Post Reply