Hi
How the below code works
Integer - OnPreDataItem()
IF i <> 0 THEN
SETRANGE(Number,1,i)
ELSE BEGIN
SETRANGE(Number,1,1);
CurrReport.SKIP;
END;
Thanks
*This post is locked for comments
Hi
How the below code works
Integer - OnPreDataItem()
IF i <> 0 THEN
SETRANGE(Number,1,i)
ELSE BEGIN
SETRANGE(Number,1,1);
CurrReport.SKIP;
END;
Thanks
*This post is locked for comments
As Amol said you can use debug and check how it works step by step.
In your code, "i" should have a value, if it is not equal to 0, integer data item would loop until "i" reach. for instance "i" = 10, then your integer data item would loop 10 times,
IF i <> 0 THEN
SETRANGE(Number,1,i)
But if the "i" is 0, then it run only one time.
BEGIN
SETRANGE(Number,1,1);
CurrReport.SKIP;
END;
But I am not sure why did you use CurrReport.Skip here, since it runs only one time if the "i" = 0.
Post here your dataitem snap-shot to get clear idea.
Why you are using CurrReport.SKIP; in OnPreDataItem trigger?
Hi,
this looks similar to 'number of copies' option. The 'i' is input somewhere (Request Page, or similar) and the DataItem runs the number of times that 'i' equals. If the 'i' is zero then this DataItem runs once.
Robertas
Try to use debugger to understand the code step by step
André Arnaud de Cal...
292,516
Super User 2025 Season 1
Martin Dráb
231,329
Most Valuable Professional
nmaenpaa
101,156