how to get sum of last row in datasource

Stimulsoft Reports.NET discussion
Post Reply
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

how to get sum of last row in datasource

Post by dmasterplan »

I have the datasource that has these values:

PackageCategory Awarded To Let
Consultants 2 1
Contractors 3 0
Suppliers 2 0
Total 7 1
(image attached)

Now, how can I get the sum of values of last row in Stimulsoft? (Total)
7 + 1
lhat would be 8

I want to put in a variable, say, vTotalPackages type Decimal

How do I do it?

Great Thanks!
Attachments
dsPackages.png
dsPackages.png (4.2 KiB) Viewed 590 times
Max Shamanov
Posts: 790
Joined: Tue Sep 07, 2021 10:11 am

Re: how to get sum of last row in datasource

Post by Max Shamanov »

Hello,

Please send us a sample report with test data.

Thank you.
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: how to get sum of last row in datasource

Post by dmasterplan »

But I can't send the database, it's huge!
User avatar
dmasterplan
Posts: 143
Joined: Thu Mar 17, 2022 4:04 am
Location: Philippines

Re: how to get sum of last row in datasource

Post by dmasterplan »

I had it solved already. I just created a datasource counting the records (packages) and assigned it to a variable.

Great Thanks!
Lech Kulikowski
Posts: 6265
Joined: Tue Mar 20, 2018 5:34 am

Re: how to get sum of last row in datasource

Post by Lech Kulikowski »

Hello,

You can use the following expression:
{SumIf(DataBand, DataSourceName.Awared,DataSourceName.PackageCategory == "Total") + SumIf(DataBand, DataSourceName.ToLeft,DataSourceName.PackageCategory == "Total")}

Thank you.
Post Reply