Show rowcount from detail table... in report footer textbox

1 Answer 380 Views
.NET Framework Report Viewer - WinForms
Van
Top achievements
Rank 1
Van asked on 19 Nov 2021, 07:36 PM

How can I get the row count from a table that is in the detail, but show that total in a textbox in the footer?

The datasource on the table in the detail doesn't seem to be accessible from anywhere but the table. 

The datasource on the report itself is different, containing some common items for display, but no data.

I've seen solutions that talk about adding a list or table to the header, but that doesn't seem to be allowed. The report designer does not allow that.  "It is not allowed to add Table to pageHeaderSection1" 

Is there a solution for this? Some way to make a report function that can be called from an expression? Or something like a field in the detail that is identified such that its value can be accessed in the footer?

Thanks

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 24 Nov 2021, 10:53 AM

Hi Van,

I noticed that you have asked the same question in the forum post Row count. I will reply also here as you provide more information on the scenario.

You need to apply the approach with the List/Table in a Report Footer or Report Header section as in the Page sections, you are not allowed to add data items. It is not possible also to access the value of a report item, for example, TextBox, in another report item.

Note that the data sources can be accessed only through the data item they are assigned to. That's the reason why you cannot access the Table data from anywhere else and you need to use a data item in the section where you should display the Table total.

As another possible workaround, can you use a List to display the common items currently displayed in the Report, and assign the main data to the Report, without using another data item? This will allow you to display aggregates also on the Page sections. Note that you will be able to aggregate by page through the PageExec Page Function.

Regards,
Todor
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Van
Top achievements
Rank 1
commented on 24 Nov 2021, 03:34 PM

Yes, sorry for the duplicate posting, I realized the other posting I replied to was quite old, so I thought nobody would see my question there.

I think I got this to work. I'm new to the reporting tool, and I didn't realize the difference between the page footer that is shown on the designer automatically, and the report footer that must be added manually. So I was trying to add a list with just a total group to the page footer.  On the report footer it works.

If my list in the report footer uses the same datasource as the table in the detail, does it cause it to be retrieved twice?  Hopefully it is just shared and only retrieved once.

Thanks for the reply!

Todor
Telerik team
commented on 29 Nov 2021, 09:56 AM

Hi Van,

I'm glad to know that the suggestion worked for you.

The data from the datasource will be retrieved once and cached for reuse. This is supported starting with version R3 2019 (13.2.19.918). With previous versions, the data would be retrieved anew for each data item.

Tags
.NET Framework Report Viewer - WinForms
Asked by
Van
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or