Separate datasource for header and detail?

3 posts, 0 answers
  1. Kjell
    Kjell avatar
    276 posts
    Member since:
    Jun 2010

    Posted 02 Aug 2010 Link to this post

    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. Peter
    Admin
    Peter avatar
    1611 posts

    Posted 04 Aug 2010 Link to this post

    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
  3. DevCraft banner
  4. Joel
    Joel avatar
    166 posts
    Member since:
    Oct 2006

    Posted 05 Aug 2010 Link to this post

    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.
Back to Top