MaxIteration

ricky76
ricky76 Member Posts: 204
I have a report with a body section that has a maxiteration of 10. If the iteration was 10 then this section would go over onto 2 pages which is fine. However if there are only two records that are to be returned in the body then i want it to stay on the one page however i can't get this to work as it prints the second page blank. Is there a way this can be done?

Regards,

Comments

  • Waldo
    Waldo Member Posts: 3,412
    Then you'll not be able to work with the property 'MaxIteration' and do everything by code.

    OnPostSection you can count for number of lines.
    With CurrReport.NEWPAGE, you can start a new page.

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • ricky76
    ricky76 Member Posts: 204
    How can i count for the number of lines?
  • Waldo
    Waldo Member Posts: 3,412
    Something like:

    declare variable (integer) (e.g. "i").
    OnPostSection: i += 1; ( :wink: )
    If i > 20 THEN
    your code

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
  • ricky76
    ricky76 Member Posts: 204
    Thanks for your help.