Nested table in Telerik reporting?

蹲街弑〆低调 提交于 2019-12-05 23:53:38

You'll want to use SubReports for this. You can read about them in Telerik's documenation or even read this help page that is specifically about master-detail reports which is like what you are doing.

Basically, you'll create two reports. The Master report will display all the Absence objects. As part of the 'detail' section of that report, you'll place a SubReport. The SubReport will show the second report which will list all the Available objects. Then you can pass a parameter from the master report to the sub report and use a filter so you only see the Availables that correspond to the passed in Absence.

Then remember that the outer report's Data Source should be all the Absences and the inner report's Data Source should be all the Availables.

I have had same problem a while ago. I figured out that Telerik Reporting has some kind of bug with nested tables. If I put Table2 (child) as cell content of Table1 (parent) and try to bind data sources (via bindings or in code, no matter) than my child Table2 will always show the same item in all rows. I try to ask in official Telerik forum about that but they just tell me to use SubReport (which, by the way, did not resolve my problem). So I was forced to use List (Telerik Reporting control) as parent content holder. And as you understand it was hard to implement such markup as in Table control.

We have just done something slimier to this in a report today.

You can add a list control into the cell of the table. Using binding on the list, bind the dataSource to the property that contains the list. You can then Add Columns in you listbox to display the data.

We are doing this by assigning the table data source as an Object in C#. I assume you could do something similar if using SQL/other datasources by attaching the relevant datasource to the list box and applying a filter with a parameter.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!