amator
25th August 2016, 06:39
Hi Guys,
I want to ask how to compare the rows in detail layout
For example:
| ROW1 | NAME | DESCRIPTION | ORDER NO |
| ROW2 | NAME | DESCRIPTION | ORDER NO |
I want to compare the ORDER NO if they are are equal or not.
Thanks in advance,
Amator
andreas.toepper
25th August 2016, 12:36
Well, I'd say, there are some possibilities, depending on what you want to do with the result of comparing the value.
First of all you can make order no part of the sorting of the report (check input fields). If order no is part of the index you can use a before- and after-fields layout for order no. They will be trigger if order no changes.
This will be an easy way to print something in the report when order no changes.
If you want to do some calculations or initialize some variables, on changing of order no, you can also use a new internal variable in the report script (i.e. old.orderno) fill it in the after.layout section of the detail.section. And compare the new variable with the order no in the before layout section of the detail.
Somewhat like this:
detail.1:
before.layout:
if old.orderno <> orderno then
doit()
endif
after.layot:
old.orderno = orderno
amator
26th August 2016, 09:28
Well, I'd say, there are some possibilities, depending on what you want to do with the result of comparing the value.
First of all you can make order no part of the sorting of the report (check input fields). If order no is part of the index you can use a before- and after-fields layout for order no. They will be trigger if order no changes.
This will be an easy way to print something in the report when order no changes.
If you want to do some calculations or initialize some variables, on changing of order no, you can also use a new internal variable in the report script (i.e. old.orderno) fill it in the after.layout section of the detail.section. And compare the new variable with the order no in the before layout section of the detail.
Somewhat like this:
detail.1:
before.layout:
if old.orderno <> orderno then
doit()
endif
after.layot:
old.orderno = orderno
I've tried what you advice I just add some customization and it works now thank you.