Programmatically check for new page in report?

Hello all [:)] Maybe somebody could help me… I would like to programmatically check to see if there has been a new page in my report. What I am trying to do is turn on a dashed line when an item number changes. This works, but I don’t want the line on the first item of every page. Here is my code: public void executeSection() { currentItemID = InventTableModule.ItemID; // somehow check for new page? // this.lineAbove(0); if (currentItemID != nextItemID) { this.lineAbove(2); } else { this.lineAbove(0); } super(); nextItemID = InventTableModule.ItemID; } Also, maybe somebody knows what I should be using as parameters instead of the 0 in this.lineAbove(0). It works, but it is not good programming [:P] Thanks, Simon Batchelder

Hello Simon, Try this. (Define lastKnownPage in classDeclaration) if (lastKnownPage != this.page()) { //New page found. Update variable. lastKnownPage = this.page(); // Do something… } else { // No new page // Do something else… } /Peter Karlsson

Peter, thanks for the reply. Unfortunately, the compiler kept giving an error saying the page() method does not exist. I am using Axapta version 3.0 SP1 if that makes any difference. Thanks, Simon Batchelder

quote:


Originally posted by simonbatchelder
Peter, thanks for the reply. Unfortunately, the compiler kept giving an error saying the page() method does not exist. I am using Axapta version 3.0 SP1 if that makes any difference. Thanks, Simon Batchelder


Ok, my misstake. In executeSession it should be element.page() My example was from a test display method on the report. /Peter Karlson

Thanks for that! Now my code works properly. Thanks again, Simon Batchelder