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

Separate datasource for header and detail?

2 Answers 756 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Kjell
Top achievements
Rank 1
Kjell asked on 02 Aug 2010, 10:51 PM
Hi.  I just started using the reporting tools to replace some XSLT reports.  My datasource is a dataset (read from XML), which contains two datatables.  One table contains just the header info, while the other table contains all the actual data.  If I set the report datasource to just the dataset, then I can only seem to to access the values in the first table (I am probably doing this wrong).  I am just using [=FieldName] in textboxes as a test, I tried specifying the table name like this [=TableName.FieldName] but that did not work.  WHat am I missing here?

2 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 04 Aug 2010, 06:04 PM
Hi Kjell,

If you are using Telerik Reporting prior to Q1 2010, use the DataMember property of the report to set explicitly the table you would like to use. This is needed as the report can be bound to a single table only. If your DataSource contains more tables, you can bind a separate report to it and take advantage of the SubReport item or use Table/List/Crosstab item to directly show data in the main report. For example you can bind your header data to a separate data item such as List and bind the report to the actual data.

If you are using Telerik Reporting Q1 2010 - you should use the ObjectDataSource component as DataSource and set its DataMember instead.

Regards,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Joel
Top achievements
Rank 2
answered on 05 Aug 2010, 02:14 PM
Another option would be to split the dataset into two tables in the "view code" page for the report.  Assign  ds.Tables(1) as the datasource for the report in "new" (assuming the second table is the one you need for detail data.  I usually then manually assign the values to the textboxes in the non-grouped header/footer sections via 
textbox1.value = ds.Tables(0).Rows(x).Item(y)

Granted, i usually bypass the built in data access and pass datasets and datatables directly to the report.  If you are dealing with groups, it doesn't work or course, but sometimes i end up having to  merge the two tables in the dataset into  a single table to accomplish that.
Tags
General Discussions
Asked by
Kjell
Top achievements
Rank 1
Answers by
Peter
Telerik team
Joel
Top achievements
Rank 2
Share this question
or