Group with IIF condition

Stimulsoft Reports.WEB discussion
Post Reply
mksch
Posts: 14
Joined: Mon Aug 17, 2020 1:10 pm

Group with IIF condition

Post by mksch »

Hello,
I am kind of new to Stimulsoft.
I am trying to create a invoice template and would like to group the transactions based on a check number. I can get the grouping to work, however there are transactions which do not contain any check number which should not be grouped at all and only the ones which do have the same check number should be grouped. Is there any way I can accomplish this?
I attached the current simple grouping that I use.

Thank you very much for your help.
stimulsoft.JPG
stimulsoft.JPG (53.43 KiB) Viewed 2061 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Group with IIF condition

Post by Lech Kulikowski »

Hello,

You can use condition in the group expression, something like:
{(Column == "" ? 0 : Column)}
or
{IIF(Column == "", 0, Column)}

Thank you.
mksch
Posts: 14
Joined: Mon Aug 17, 2020 1:10 pm

Re: Group with IIF condition

Post by mksch »

Hi Lech,
thank you very much for your quick reply. I tried using the expressions you mentioned, but still the grouping would also be applied to lines which do not have a check number.
grouping.JPG
grouping.JPG (91.03 KiB) Viewed 2055 times
The data looks like this:
Description Amount CheckNumber
Food 10 123
Beverage 5 123
Accommodation 100
Accommodation 100

On the invoice it should group Food and Beverage based on the Check Number, but the Accommodation should not be grouped at all as these have no check number and need to print separately. It should look something like this, where the description is not that important for now:
Description Amount CheckNumber
F&B 15 123
Accommodation 100
Accommodation 100

Do you have any other thoughts on this?

Thank you very much.
Best regards,
Markus
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Group with IIF condition

Post by Lech Kulikowski »

Hello,

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

Thank you.
mksch
Posts: 14
Joined: Mon Aug 17, 2020 1:10 pm

Re: Group with IIF condition

Post by mksch »

Enclosed please find the sample report.
Thank you very much.
Best regards,
Markus
Attachments
Report (14).mrt
(636.42 KiB) Downloaded 129 times
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Group with IIF condition

Post by Lech Kulikowski »

Hello,

Please send us a test data for your report.

Thank you.
mksch
Posts: 14
Joined: Mon Aug 17, 2020 1:10 pm

Re: Group with IIF condition

Post by mksch »

Hello Lech,
in which format would you need the test data, I am using Stimulsoft integrated in a cloud application and have no access to the database to extract any data and am bound to the objects delivered by the development team. Is there another way I can provide the data or we can try to address my question?

Thank you very much.
Best regards,
Markus
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Group with IIF condition

Post by Lech Kulikowski »

Hello,

In any format that we can add in your report and run it (XML, JSON, CSV, etc)

Thank you.
mksch
Posts: 14
Joined: Mon Aug 17, 2020 1:10 pm

Re: Group with IIF condition

Post by mksch »

Hello Lech,
i believe i got it working by adding another object in the if statement instead of the zero which provides a unique identifier per posting.
thank you very much for your help.
Andrew
Posts: 4106
Joined: Fri Jun 09, 2006 3:58 am

Re: Group with IIF condition

Post by Andrew »

Hello,

You are welcome!
Post Reply