Migration of Reports - Need a good strategy

1 Answer 151 Views
Binding DataSource Object
David
Top achievements
Rank 1
Iron
Veteran
Iron
David asked on 10 Mar 2023, 06:25 PM

I am migrating from the .CS version of reports to the .trdp format.  Overall the results have been good.  I have had to do some minor tweaks to a few data structures but noting significant.

I have run into a scenario for which I have not been able to come up with a solution.  Hopefully someone will have a bright idea for me.

I have an existing report which has 7 sub-reports.  The main report has a dataset which has all the data for the child sub reports.  Each child report have a single parameter that controls logic on how the data is formatted/presented when rendered.  Under the ".cs" flavor, I had more control of the data binding process and could point each sub report to its relevant data source and set the parameter to the required values.  I seem to lack this ability in the .trdp flavors.

While 7 sub-reports sounds large,  it actually is 3 reports with the same sub-report being re-used with different data sources and parameters.

The root/parent reports data looks like the following:



List<reportAData> report1data
List<reportAData> report2Data
List<reportAData> report3Data
List<reportBData> report4Data
List<reportBData> report5Data
List<reportBData> report6Data
List<reportCData> report7Data

In theory I need to set the data source of sub report #1 to "report1Data", set its parameter to the root parameter "A".  Then set sub report #2 to "report2Data" and set its parameter to the parent parameter "B".  The same repeats for the rest of the data.

I do not know how to do that.  The instructions I have seen say to open the child sub-report and modify its's bindings to use the parents data object.  That would work however I have the same sub-report being used 3 times with different sources and different parameters.

Any suggestions for a strategy?

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 15 Mar 2023, 09:45 AM

Hello David,

Thank you for the provided information!

I would like to start by saying that starting with the ProgressĀ® TelerikĀ® Reporting R3 2022 SP1 (16.2.22.1109) release, the SubReport item now exposes a DataSource property which means, that it will be easier to assign data to it from the main report and I highly recommend upgrading to at least this version if you are using an older one.

Since now the SubReport.DataSource property is exposed, you may assign data to it in the same way you would with any data item such as the table, the crosstab, the graph, etc. Any data component should work with the SubReport.

This means that there are a couple of ways for achieving what you need and the two that I would recommend are the following:

  • Split the data into separate data source components and have them easily assigned to your SubReports' DataSources
  • Have the complete dataset assigned to the main report and then via bindings, set the lists' data to the corresponding SubReports, for example:

This way, you can distribute your fields' data across your SubReports from the main report. For more details on the new SubReport.DataSource property, please see the SubReport Report Item at a Glance - Telerik Reporting article.

Thank you for using Telerik Reporting!

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Binding DataSource Object
Asked by
David
Top achievements
Rank 1
Iron
Veteran
Iron
Answers by
Dimitar
Telerik team
Share this question
or