Page 1 of 1
Group with IIF condition
Posted: Mon Aug 17, 2020 1:22 pm
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 (53.43 KiB) Viewed 3209 times
Re: Group with IIF condition
Posted: Tue Aug 18, 2020 7:49 am
by Lech Kulikowski
Hello,
You can use condition in the group expression, something like:
{(Column == "" ? 0 : Column)}
or
{IIF(Column == "", 0, Column)}
Thank you.
Re: Group with IIF condition
Posted: Tue Aug 18, 2020 9:34 am
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 (91.03 KiB) Viewed 3203 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
Re: Group with IIF condition
Posted: Tue Aug 18, 2020 10:07 am
by Lech Kulikowski
Hello,
Please send us a sample report with test data that reproduces the issue for analysis.
Thank you.
Re: Group with IIF condition
Posted: Tue Aug 18, 2020 10:52 am
by mksch
Enclosed please find the sample report.
Thank you very much.
Best regards,
Markus
Re: Group with IIF condition
Posted: Wed Aug 19, 2020 7:29 am
by Lech Kulikowski
Hello,
Please send us a test data for your report.
Thank you.
Re: Group with IIF condition
Posted: Wed Aug 19, 2020 7:58 am
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
Re: Group with IIF condition
Posted: Wed Aug 19, 2020 8:15 am
by Lech Kulikowski
Hello,
In any format that we can add in your report and run it (XML, JSON, CSV, etc)
Thank you.
Re: Group with IIF condition
Posted: Thu Aug 20, 2020 2:30 pm
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.
Re: Group with IIF condition
Posted: Fri Aug 21, 2020 5:53 am
by Andrew
Hello,
You are welcome!