NewPagePerGroup Property Navision Report.

I have a requirement of setting the NewPagePerGroup property via code.

How to set this property through code.

I have created a report and added a check box which will allow user to show details if he select or not.

My requirement is that when the user select the show details (TRUE) then the report should set the NewPagePerGroup to TRUE else FALSE.

If i am setting it to TRUE from the property it is also working when the user does not select to view the details.

Did you something like

IF (CurrReport.TOTALSCAUSEDBY = FIELDNO(Item) AND Showdetails) THEN
  CurrReport.NEWPAGE;

Yes i have tried it.

But it is shifting the PAGE FOOTER total (GRAND TOTAL) to the next page also else it is working fine. It is breaking the pages but the totals i put on page footer is shifted to new page also.

Do you want to print Footer on every page?

then set PrintOnEveryPage to yes in footer section

No i dont want to display page footer on every page.

Let me explain in more detail.

I have following arrangement on my report.

GROUP FOOTER(7) which is displaying the group total.

GROUP FOOTER(8) This is a blank section nothing here except i wrote the following code:

IF SHOWDETAIL THEN CURRREPORT.NEWPAGE;

THIS CODE SENDS THE FOOTER TO PRINT ON A NEW PAGE I DONT WANT IT TO PRINT ON THE NEW PAGE IT SHOULD CONTINUE WITH THE SAME PAGE. Like it is working when i select the property NewPagePerGroup Property to YES.

FOOTER(9) This is displaying the Grand Total for the whole report.