Getting DataSet during report rendering

Stimulsoft Reports.NET discussion
Post Reply
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Getting DataSet during report rendering

Post 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
Edward
Posts: 2913
Joined: Fri Jun 09, 2006 4:02 am

Getting DataSet during report rendering

Post by Edward »

Do you get data for the report via RegData() method or via a connection from the code.

Thank you.
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Getting DataSet during report rendering

Post 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
jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Getting DataSet during report rendering

Post 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

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Getting DataSet during report rendering

Post 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.


jing
Posts: 50
Joined: Fri Jan 26, 2007 12:47 am
Location: New Zealand

Getting DataSet during report rendering

Post 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?)

Vital
Posts: 1278
Joined: Fri Jun 09, 2006 4:04 am

Getting DataSet during report rendering

Post 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.
Post Reply