Hi,
Lets suppose that Region consists of multiple Areas
I have two reports: RegionReport and AreaReport that I would like to combine into one report book.
RegionReport takes one non-mergable parameter, integer - regionId, that I use in NeedDataSoruce in my db query.
In my report book I am trying to achieve the following:
RegionReport - ie California
AreaReport - Sacramento
AreaReport - LA
RegionReport - ie Texas
AreaReport - Dallas
AreaReport - Huston
To achieve this I construct the report book in the following way:
When processing the reports, in NeedDataSource event, the value for the RegionId paramenter in the following code is always of the last value added. In other words it is not preserved from one RegionReport to another.
What is the proper way of preserving individual reports paramenters' values in a report book ?
Thank you
Pawel Mozdzen
Lets suppose that Region consists of multiple Areas
I have two reports: RegionReport and AreaReport that I would like to combine into one report book.
RegionReport takes one non-mergable parameter, integer - regionId, that I use in NeedDataSoruce in my db query.
In my report book I am trying to achieve the following:
RegionReport - ie California
AreaReport - Sacramento
AreaReport - LA
RegionReport - ie Texas
AreaReport - Dallas
AreaReport - Huston
To achieve this I construct the report book in the following way:
reportBook = new ReportBook(); |
for (int i = 0; i < regionList.Count; i++) |
{ |
RegionReport regionReport = new RegionReport(); |
regionReport.ReportParameters["RegionId"].Value = regionList[j]; |
reportBook.Reports.Add(regionReport); |
for (int j = 0; j < areaList.Count; j++) |
{ |
AreaReport areaReport = new AreaReport(); |
areaReport.ReportParameters["AreaId"].Value = areaList[j]; |
reportBook.Reports.Add(areaReport); |
} |
} |
When processing the reports, in NeedDataSource event, the value for the RegionId paramenter in the following code is always of the last value added. In other words it is not preserved from one RegionReport to another.
private void RegionReport_NeedDataSource(object sender, EventArgs e) |
{ |
Telerik.Reporting.Processing.Report report = (Telerik.Reporting.Processing.Report)sender; |
//If I had two RegionReport reports added to the book, RegionId parameter's value would be always of the last one added. |
int param = Convert.ToInt16(this.ReportParameters["RegionId"].Value); |
... |
What is the proper way of preserving individual reports paramenters' values in a report book ?
Thank you
Pawel Mozdzen