Monday 12 September 2011

How to insert a Page footer on the last page in Axapta report

Hi, 
Normally developers need the term and condition or other stuff to be displayed only on the last page .To insert the footer only on the last page of Axapta report do the following stes.
1. Declare a boolean variable (pageFooter) in report class declaration method .

             public class ReportRun extends ObjectRun
            {
                 boolean pageFooter;
            }
2. Override the report fetch method with query 
          public boolean fetch()
          {
               boolean ret;
               ret = super();
               printPageFooter=false;
                while(queryrun.next())
                {


                }
               printPageFooter=true;
               return true;
          }


3. Override the executeSection method of footer 
      
          public void executeSection()
          {
                if(printPageFooter==true)


                super();
           }


and your done now when ever your will run a report only the last page will display the page footer. 
Regards,