This is a migrated thread and some comments may be shown as answers.

Is it possible to use a dataset as the datasource for a report with groups?

2 Answers 363 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Will
Top achievements
Rank 1
Will asked on 12 Nov 2013, 01:25 PM
Hello.  I'm using the Q2 2012 version of Telerik Reports and a, generating a report that will display details of transactions on insurance policies grouped by coverage codes.

Ideally, I'd like to use a single report, avoiding a subreport.

Would my version of Telerik reporting allow me to use a dataset with the proper Dataset.Relations added in my BL and put the transactions in the detail section, and their Coverage code one level up in the Group header, I'm thinking something similar to the way RadGrid can generate nested grids with relationships between the MasterTable and DetailTable?

If so, could you point me towards some code samples showing how to set the ObjectDataSource.DataSource = myDataset or what to do in the NeedDataSource events to wire this up correctly?

I expect I can do this with the Table object, but frankly, I've been stymied by how to use that one.

Thanks.



2 Answers, 1 is accepted

Sort by
0
Accepted
Stef
Telerik team
answered on 15 Nov 2013, 12:41 PM
Hi Will,

Create a custom Business Object loaded with the data from the DataSet and having directly the relations between objects - the object can be wrapped within an ObjectDataSource component. Then you can bind data items in the report to the business object's collection properties or to the business object data as well using the ReportItem.DataObject. Whether you will use nested Table items or Table item in the details section depends on the desired layout.

For example take a look at the attached example:
  • Report1 works with flatten data;
  • Report2 works with hierarchical data and uses the described above approach to bind the nested Table item to a collection property of the business object. The second row of the master Table is added to the same group as the detail row, and has merged cells(select cells from the same row group and Merge Cells from the Context Menu)

More details about the Table item can be found in the following help articles:

Let us know if you have any further questions.

Regards,

Stef
Telerik

New HTML5/JS REPORT VIEWER with MOBILE AND TOUCH SUPPORT available in Telerik Reporting Q3 2013! Get the new Reporting version from your account or download a trial.

0
Will
Top achievements
Rank 1
answered on 04 Dec 2013, 03:21 PM
Hey there.  I wanted to get back to you and thank you for your help.

After I posted, just because we're trying to get this project out on time and on budget, I addressed by flattening the tables and then using group sections (which I believe is what you showed in your first example).

Yesterday I revisited this topic, looked at report2 in your example, and between that and a couple rounds of "try something, see why it doesn't work, change something, repeat" I got a table object implemented.

This is going to make a huge difference in my reports.  I believe I'll be able to give the Analyst as complicated a report as she wants and still hit the intersection of complexity and cost.

Thank you. Telerik, in general, and Stef, in particular.
Tags
General Discussions
Asked by
Will
Top achievements
Rank 1
Answers by
Stef
Telerik team
Will
Top achievements
Rank 1
Share this question
or