Page 1 of 1
Getting DataSet during report rendering
Posted: Mon Feb 19, 2007 3:58 pm
by jing
Hi,
Is it possible to get the dataset during report rendering (ie. before the report is outputed to the previewer control)
I would like to modify the dataset before the report outputed to the preview control (ie. adding rows into the dataset, based on quantity)
Thank you very much
Getting DataSet during report rendering
Posted: Tue Feb 20, 2007 3:49 am
by Edward
Do you get data for the report via RegData() method or via a connection from the code.
Thank you.
Getting DataSet during report rendering
Posted: Tue Feb 20, 2007 1:42 pm
by jing
I got the data via a connection from the code. I setup the database and datasources via code, then open the designer. (I didn't use RegData because we would like the user to change the sql query behind the datasource....)
Thanks
Getting DataSet during report rendering
Posted: Tue Feb 20, 2007 3:45 pm
by jing
I managed to get the dataset by using the sql query that's already in the report and added some rows to that dataset and managed to print the report using a the dataset- all is well now
Thanks
Getting DataSet during report rendering
Posted: Tue Feb 20, 2007 8:07 pm
by Vital
1. You can use property DataTable of datasource: Customers.DataTable;
2. For data source from SQL connection you can use dataset this.Dictionary.CacheDataSet.
Thank you.
Getting DataSet during report rendering
Posted: Tue Feb 20, 2007 8:41 pm
by jing
2. For data source from SQL connection you can use dataset this.Dictionary.CacheDataSet.
Wouldn't this only work if the report has finished rendering? (otherwise wouldn't dataset be empty?)
Getting DataSet during report rendering
Posted: Wed Feb 21, 2007 12:39 am
by Vital
This dataset is filled with data from connections after BeginRenderEvent of report. So if you check this dataset in this event it will be empty.
You need process this dataset in BeginRenderEvent of first page (for example).
Thank you.