Data Item Integer - How it works? Newbie question

nav_studentnav_student Member Posts: 175
Hi guys i try to understand the DataItem - Integer( is not explained on Microsoft Manual).

Can you help to understand the Sales Invoice. This report has Integer (CopyLoop, PageLoop and DimensionLoop). What is the function of each one?


Thanks in advance.

Comments

  • ProcatProcat Member Posts: 31
    Integer in Data Item is used when you want to add an extra section, it's like to have MaxIteration set to 1 or a similar filter. Basicly, whenever you need a section printed but don't have anything meaningful to loop through.
  • matttraxmatttrax Member Posts: 2,309
    Think of the Integer data item like a FOR loop.

    Usually in order to repeat some code you would do something like

    FOR i := Min TO Max DO BEGIN
    //My Code
    END;

    The Integer data item is your FOR loop. Instead of a variable your iterator is the Number field from the Integer table. You'll see it set in either the Properties of the data item or the OnPreDataItem trigger with SETRANGE. These set the Min and Max values and, much like the loop, the report handles the actual increment of the iterator.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I wouldn't have said it in a better way. :D
    And as Procat said, imagine that sometimes your loop will have only one iteration.
    Furthermore there is one thing to consider as well. When the loop is used to run through all records of a temporary table there might be some code in OnAfterGetRecord to delimit the loop and step through the temporary table.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
Sign In or Register to comment.