Skip to main content

Posts

Call SSRS Report through controller class in ax 2012

To Call SSRS Report through controller class  Go to main method in controller class and write below code to call the report. SSRSRPTController controller; controller = new SSRSRPTController(); controller.parmArgs(args); controller.parmReportName(ssrsReportStr(TestReport, report)); controller.parmShowDialog(true); controller.startOperation()

Call SSRS Repart class and Table data through Job in Ax 2012

To SSRS Repart class and Table data through Job in Ax 2012 you can try below code. TestTmp tempTable; TestDP dataProvider = new TestDP(); TestContract contract = new TestContract(); contract.parmCustAccount("Test00001"); contract.parmNofSample(8); dataProvider.parmDataContract(contract); dataProvider.processReport(); tempTable = dataProvider.getTestTmp(); while select tempTable { info(strFmt("%1,%2,%3,%4",tempTable.CurrencyCode,tempTable.SalesId,tempTable.Monthname,tempTable.CurrentMonthSum)); } Here TestDP is data provider class for SSRS Report and TestContract is contract class . To pass parameter value we used parmCustAccount and parmNofSample method from contract class. tempTable is temparary table used in DP class.

How to get Country Name by Country code for Sales order in Ax 2012

To  get Country Name by Country code for Sales order in Ax 2012 you can try below code. LogisticsAddressCountryRegionTranslation::find (LogisticsPostalAddress::findRecId (salesTable.DeliveryPostalAddress).CountryRegionId,'EN-US').ShortName Like code is SAU then if you want to display name of SAU as Saudi Arabia then you need to find it from LogisticsAddressCountryRegionTranslation table .

Hide dialog for SSRS Report in ax 2012

To Hide dialog for SSRS Report in ax 2012 you need to go to controller class and follow below steps. Go to Controller class then go to  main method of class. Find  statement : Controller.startOperation(); then specify the below statement to hide dialog box which used for range selection. Controller.parmShowDialog(false); To show dialog you can pass value true instead of false.