Debug/Test SSRS report in AX 2012
People came across issues like report is not showing data on report or data is not per their expectation. It is really hard to judge where it goes wrong and what needs to be correct in which class RDP, Contract, UI or Controller. Following sample job can be used to debug SSRS report processing data and lead to find what goes unexpected. For more information about classes and table used in this example please read my previous post static void FF_ReportDPTest(Args _args) { // temp table declaration FF_ReportTmpTable ffReportTmp; // RDP class binded with FF_Report FF_ReportDP dataProvider = new FF_ReportDP(); // Contract class for report parameters FF_ReportContract contract = new FF_ReportContract(); // Parameters for reports FreeText companyName; CustAccount customerAccount; // set parameters to contract class contract.parmCompany(companyName); contract.parmCustomerAccount(customerAccount); // set contract parameters to RDP class dataProvider.parmDataContract(contract); // call Data provider class to process report. dataProvider.processReport(); // retrieve data from RDP class into temp table ffReportTmp = dataProvider.getFF_ReportReportTmp(); // select data from temp table for testing purpose. while select ffReportTmp { info(ffReportTmp.AccountNum); } }
Run SSRS report from AX form
Continue from my previous post where I developed an example using all SSRS framework classes. One of them is controller class which is used to call SRS report from AX forms. Just for the note controller class is used for following purposes. Modifying a report query based on the input data Modifying report contract data based on the input data Control a report parameters dialog Open different reports/designs from the same menu item based on the input data Reports that are opened from a form Example; how to call report from AX form button/menuitembutton click void clicked() { CustOpenInvoices custOpenInvoicesLocal; SrsReportRunController controller = new FF_ReportController(); SrsReportDataContract contract; FF_ReportContract rdpContractClass; controller.parmReportName(ssrsReportStr(FF_Report, PrecisionDesign)); controller.parmLoadFromSysLastValue(false); contract = controller.parmReportContract(); rdpContractClass = contract.parmRdpContract() as FF_ReportContract; rdpContractClass.parmCompany(Company.valueStr()); controller.startOperation(); }