Options

How do i change the MaxIteration Property in code in a report if a condition is fullfilled

i am designing a report that shows customer comments, i have a request form for which the user can choose to see only the latest comment. how do i achieve that using maxiteration, or is there another way. thank you

Best Answer

  • Options
    gwaindepygwaindepy Member Posts: 13
    Answer ✓
    thank you for your effort..this is what i did to solve the problem. i used the currreport.skip with an iterator.i declared an integer variable that increments after the first comment is fetched, before displaying the 2nd comment the program checks if my iterator is 0, else it skips record.

Answers

  • Options
    vaprogvaprog Member Posts: 1,118
    Unless you need this to be dynamic in the report viewer, the easiest way to get there is to filter the records in the dataset while generating the dataset on the NAV side.
  • Options
    gwaindepygwaindepy Member Posts: 13
    i want it to be dynamic, so that the user can tick the "show latest comment" checkbox thus showing only one comment. this however requires me to set maxiteration in code rather than in properties.that is what i am failing to do
  • Options
    vaprogvaprog Member Posts: 1,118
    I am not sure whether we are talking about the same thing. There are (at least) two levels of user control.

    If the user selects the option on the NAV Report request page, you don't need the dataitem's MaxIteration property. You can count yourself and use CurrReport.BREAK when needed.

    If the user must be able to toggle, within the Report Viewer, after the results show, the amount of comments he sees, then you always need to provide all comments in the dataset and manipulate the report layout controls. I do not have any experience with this, so I can't help you with this.
  • Options
    gwaindepygwaindepy Member Posts: 13
    Answer ✓
    thank you for your effort..this is what i did to solve the problem. i used the currreport.skip with an iterator.i declared an integer variable that increments after the first comment is fetched, before displaying the 2nd comment the program checks if my iterator is 0, else it skips record.
Sign In or Register to comment.