Dynamic amount of total lines in footer

Stimulsoft Reports.NET discussion
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Dynamic amount of total lines in footer

Post by Artimidor »

I was wondering if there's a way to get a kind of dynamic amount of totals into a footer based on a data band. Usually the footer shows a sum of a particular column (e.g. amount) of all the lines of the data table. Or there are groupings and totals per groupings. What I'd require are extra totals per grouping based on a particular field of the data table, but at the end of the whole thing.

Example table (3 columns: ProductName, TaxCode, Amount):
Product 1 / A / 11.00
Product 2 / A / 22.00
Product 3 / B / 33.00
Product 4 / B / 44.00
Product 5 / C / 55.00
Total 155

I try to get 3 extra totals here at the end, yielding the totals per TaxCode (A, B and C, or depending on how many different TaxCodes there are in the data table) while maintaing the grouping/order as shown. Should look like this:

Product 1 / A / 11.00
Product 2 / A / 22.00
Product 3 / B / 33.00
Product 4 / B / 44.00
Product 5 / C / 55.00
Total A 33.00
Total B 77.00
Total C 55.00
Total 155.00

Is there any way to achieve this, solely by ways of designing the report?

Thanks in advance for any ideas.
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: Dynamic amount of total lines in footer

Post by Lech Kulikowski »

Hello,

You can try to add an additional GroupHeader+DataBand block after main section, in which group data and show only totals.

Thank you.
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: Dynamic amount of total lines in footer

Post by Artimidor »

Hello there!

Well, maybe I wasn't clear enough still. I guess what you suggest is that I first show all the details and then all the totals. Looks simple enough, if this is all the report is supposed to show. But the problem in my case is that I need to show all this per grouping, e.g. a category. Like this:

Category 1
Product 1 / A / 11.00
Product 2 / A / 22.00
Product 3 / B / 33.00
Product 4 / B / 44.00
Product 5 / C / 55.00
Category Total A 33.00
Category Total B 77.00
Category Total C 55.00
Category Total 155.00

Category 2
Product 1 / A / 5.00
Product 2 / A / 4.00
Product 3 / B / 10.00
Category Total A 9.00
Category Total B 10.00
Category Total 19.00

So I first have a GroupHeader (Condition Category), then the Data, then the Footer. Now I need to insert the Totals per Category, but Totals A, B and C can't be added simply by adding a grouping in between the main data and the category total, or?

Thanks in advance for any suggestions!
Lech Kulikowski
Posts: 6254
Joined: Tue Mar 20, 2018 5:34 am

Re: Dynamic amount of total lines in footer

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: Dynamic amount of total lines in footer

Post by Artimidor »

Here's the report and the matching data source.

Goal would be in this case to have one extra total line per DepreciationPercent value per category (e.g. in the Food category this would mean one line for the 50% totals and one line for the 100% totals). This should be inserted before the totals line of the category. And the same with the other categories.
Attachments
report.mrt
(48.56 KiB) Downloaded 119 times
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: Dynamic amount of total lines in footer

Post by Artimidor »

Hmmm... Only the mrt shows up, so I'll attach the data source in this post.
Attachments
write-offs-data-source.json
(4.07 KiB) Downloaded 139 times
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamic amount of total lines in footer

Post by HighAley »

Hello.

If you need to get an additional list, you should add one more data band with grouping.
Please, look at the attached report template.

Thank you.
Attachments
report(5).mrt
(50.9 KiB) Downloaded 168 times
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: Dynamic amount of total lines in footer

Post by Artimidor »

Hello there!

Thanks for looking into the matter, but I fear this was not my question. See above, or to rephrase it: I'm looking for a way to insert these totals per category into the category section before the overall total for the section. That's the challenge. Right now, with this solution, the totals are simply attached at the very end.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Dynamic amount of total lines in footer

Post by HighAley »

Hello.

Yes, this is a solution for you.
You could add the grand total after the totals for each group.

Thank you.
Artimidor
Posts: 38
Joined: Thu Jan 09, 2020 8:15 am

Re: Dynamic amount of total lines in footer

Post by Artimidor »

The question is about positioning these totals, not about computing them.

Like so:
Food category
1000 / 50%
1001 / 50%
1002 / 100%
1002 / 50%
Total 50%
Total 100%

Total Food category

Beverages category
2001 / 100%
2002 / 100%
2003 / 100%
2004 / 100%
2006 / 100%
Total 100%
Total Beverages category

You don't address this issue. If it's not possible, please say so.
Post Reply