poppins
1
Hi everyone,
I am trying to modify the rounding precision for certain items…so I built a report based on Item table with the following code:
OnPreDataItem() trigger
recItem.SETFILTER("No.",'%1 | %2,','1000','1001');
OnAfterGetRecord() trigger
CurrReport.BREAK;
OnPreReport() trigger
IF recItem.FINDSET THEN
BEGIN
REPEAT
recItem."Rounding Precision":=0.01;
recItem.MODIFY;
UNTIL recItem.NEXT=0;
END;
The result I get is that all the items have been modified, not just those I set with SETFILTER…
I feel that the code is mis-placed…
Can you help???
On Prereport trigger will be excecuted before onpredataitem trigger…so it loop through all items and modified…
poppins
3
I told you I felt the code is mis-placed…So, where to place the code for a correct result???
What are the dataitems you have?
What is the main purpose of report?
poppins
5
I have only one dataItem based on the Item table…
The purpose of the report is to change the rounding precision for certain items…
Did you also take recItem as variable?
then remove it and set
SETFILTER(“No.”,’%1 | %2,’,‘1000’,‘1001’);
filter in OnpreDataitem
and
“Rounding Precision”:=0.01;
MODIFY;
in OnAftergetrecord trigger…
poppins
8
I tried what you said and it only modified the first item mentionned in the filter…
You wrote below code in OnAftergetrecord trigger only, right?
“Rounding Precision”:=0.01;
MODIFY;
Remove , after %2 in below statement
SETFILTER(“No.”,’%1 | %2,’,‘1000’,‘1001’);
should be
SETFILTER(“No.”,’%1 | %2’,‘1000’,‘1001’);
poppins
12
[:$]
Thank you for your patience!!!