Page 1 of 1

Manipulate the datasource before show

Posted: Tue Jan 01, 2008 11:24 pm
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.

Manipulate the datasource before show

Posted: Wed Jan 02, 2008 3:32 am
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.