Loops in a report

sabzam
sabzam Member Posts: 1,149
Dear All,

I have some problem understanding the loops in a report. I am speaking
of loops similar to the one in the Sales Document Test.

In Other words what I need is to have a section which is to be looped for a number of times. In my case I have got a footer which is to be run 20 times since i have got an array which is to be displayed. Is there a way of forcing the footer to run 20 times instead of placing all the loop data manually?

Can anyone help me?

Comments

  • matttrax
    matttrax Member Posts: 2,309
    I think you are trying to do something like this, similar to the copyLoop or PageLoop on some reports.

    Add a section of type integer.
    In the onPreDataItem trigger put SETRANGE(Number, 1, 20);
    Add your footer section.
    Add a textBox to that section with sourceExpr = Array[Integer.Number]

    That should do the trick.
  • sabzam
    sabzam Member Posts: 1,149
    I'll test it out and let you know whether it works properly
  • sabzam
    sabzam Member Posts: 1,149
    Hi matttrax

    It has worked properly. The only problem is this. I want it to act like a footer in the sense that the loop is to be run once at the very end of the report. Any idea of how to run a body with this characteristic?
  • sabzam
    sabzam Member Posts: 1,149
    Hi Everybody,

    I have got two inter-related loops, I.e for every time the loop is run another loop runs for 20 time or so. In this case since we must write

    Setrange (Number ,1, x) instead of Number which variable could be used beause it seems that Navision has problems when other variables of the same type are used.
  • Eugene
    Eugene Member Posts: 309
    here Number is a field name of a virtual table Integer
    basically u do
    Integer.SETRANGE(Integer.Number, 1, 20);