Embedding one (or more) tables inside of a table

2 Answers 346 Views
General Discussions Report Designer
Derek
Top achievements
Rank 1
Iron
Derek asked on 26 Jun 2023, 05:50 PM

Hello,

I am currently working on a report in which I need to embed a table (with its own headers) into another table. I am trying to make my telerik report match the table in the attached "Model Table.jpg" where the main table has the headers "num records", "total attempts", "client ID", etc.. and the embedded table has the headers "attempts", "date refused", and "comments".

I was able to create the main table in a report, then merge the cells in the row below and add the sub table; however, the sub table is repeated with every new row. The report in this instance can be seen in the attached "sub table.jpg".

I then attempted adding a subreport inside the main table. This subreport links to a separate report containing the "attempts", "date refused", and "comments" table. However, I ran into some roadblocks with this as well. When the subreport is outside the table, it loads fine with all values showing. Unfortunately, when I move the subreport into the main table, I cannot get it to load properly. When I add the datasource to the subreport (same datasource as the main report), the subreport doesn't show at all. When I remove the datasource from the subreport, the headers of the sub table show, but no data loads. Is there a reason the subreport wont load properly inside the table?

Hopefully this all made sense- please let me know if you need any clarification on anything.

Thank you!

2 Answers, 1 is accepted

Sort by
0
Accepted
Derek
Top achievements
Rank 1
Iron
answered on 10 Aug 2023, 02:10 PM

Hey Dimitar,

Thanks for your detailed response! And apologies for responding so late to it. I attempted the suggestions you provided, and while they were helpful, I found an easier solution through my testing.

One of the fields in my main (parent) table was a unique ID number, so we placed 2 subreports inside the parent table and linked them using this ID number. The ID number was the parameter we used to generate data in these subreport.

Thanks again for your assistance!

1
Dimitar
Telerik team
answered on 28 Jun 2023, 01:48 PM

Hello Derek,

Thank you for the attached screenshots and the additional information!

Regarding the nested table approach, that should work the same as nesting any data item. Whether the nested item will be repeated on every row or only on a new instance of a group row, that depends on what group the item is inserted. If you had inserted the SubReport in the same place, it should also be rendered for each row.

Considering that the table was repeated for every record, and I assume this is unwanted, it would mean that the row on which it was inserted was part of a 'detail' group. Such groups render every record thus the nested table being shown on each row. For more details on this and the other types of groups, I highly recommend having a look at the Grouping Data at a Glance - Telerik Reporting article.

Regarding the SubReport problems, I am afraid that I cannot accurately diagnose what could be the cause without seeing the report definition but judging on what information has been provided so far, I would suspect some kind of problem with the data provided to the SubReport. If you need more help with figuring it out, please send me the report definition and some sample data that I can use to preview the report(s) locally and test the problem.

I would also suggest having a look at the Nesting Graphs in a Table Item - Telerik Reporting article if you haven't already. It is about nesting a graph but the approach would be exactly the same with a table, or subreport since they are all data items and behave the same in that aspect.

I hope the provided information will help.

Regards,
Dimitar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
General Discussions Report Designer
Asked by
Derek
Top achievements
Rank 1
Iron
Answers by
Derek
Top achievements
Rank 1
Iron
Dimitar
Telerik team
Share this question
or