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

Reporting using xml for data and subreports for child nodes

1 Answer 119 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
dtm
Top achievements
Rank 1
dtm asked on 26 Sep 2007, 05:24 AM
Hi,

I have xml like the following

<User Id="1" Name="test">
    <Item Id="123" Title="blah1"/>
    <Item Id="1234" Title="blah2"/>
    <Item Id="1235" Title="blah3"/>
    <Item Id="1236" Title="blah4"/>
</User>

i would like to have a master report with the Name value shown and then either a grouped or subreport to show the list of Items with there titles displayed

As i am using xml as datasource so i have created a DataTable but it doesn't seem to allow for complex relationship so i have tried parameter passing but when accessing ReportParameters[0].Value from the subreport the value is always empty even though the Name and Type have values.


1 Answer, 1 is accepted

Sort by
0
Hrisi
Telerik team
answered on 26 Sep 2007, 02:57 PM

Hello dtm,

This is not so easy task. First you should create a DataSet and use DataSet.ReadXml(file) to fill the dataset. Then you will see the 2 tables that were created - "User" and "Item". "Item" has a hidden column "User_Id" used in relation created between User.Id and Item.User_Id. Such related tables can be represented by Master-Detail report (i.e. a Report bound to the "User" table and a SubReport bound to "Item" table).

If you want to use grouping, you should create the Table contained data from the joined "User" and "Item" tables.

Our Reporting engine now works with flat data sources (table-like) only, but we have plans to add support for hierarchical datasets in the near future.
 

Sincerely yours,

Hrisi
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
General Discussions
Asked by
dtm
Top achievements
Rank 1
Answers by
Hrisi
Telerik team
Share this question
or