How to Enable(Visible) or disable(Invisible) any report Section (header, Footer, Page Header, Page Footer etc.) by X++ for Ax AOT Reports in Ax 2009 or higher

As we know in AOT Reports there is a property called visible for the controls in the report. But for the report Section (header, Footer, Page Header, Page Footer etc) property does not exist. So we can do that from following code by writing this in fetch method as per your logic

ReportSection      reportSection ;  

        reportSection = this.design().sectionName(‘PageFooter’);
        this.disableSection(PageFooter);// used for Disable Report section
        this.enableSection(reportSection);//used for Enable Report section

//this.enablePageFooter(); // this is used to enable page footer