Monday, March 14, 2011

Display Page Footer only in the last page of the report in AX 2009

Hi Folks,

I have seen that most of the developers face the problem in displaying the Page footer only in the last page of the report. Epilog is printed just after the page footer on the last page in a report. So, this is printed in a separate page. But to print in the last page footer, the process is as follows:

  1. Declare a boolean variable(boolean printPageFooter) in the class declaration.
  2. In the fetch method, before looping the query make the boolean variable false and after running the complete query make the boolean variable to true.printPageFooter = false;
while (queryrun.next())
{

}
printPageFooter = true;
ret true;


Now override the executeMethod of the Page footer in which this section is executed only if the boolean variable is set to true.

Thats it................The problem is solved.

3 comments:

Jahan Zaib shaikh said...

thanx, its really helpfull

Mehul Thacker said...

But if we are not using fetch method in report and printing simple report then?
How can we find "Last Page Number" in AX 2009 Reports?

Mehul Thacker said...

But if we are not using Fetch method then?

How can we find Last page number in AX 2009 report?