Thursday, October 20, 2016

Run report SSRS SrsReportRunController and passing parameter from form in AX 2012 R3


void clicked()
{
    Query query;
    LedgerJournalTable          dataTable;
    SrsReportRunController      controller;
    ;

    dataTable = LedgerJournalTable;

    //info(strFmt('%1',dataTable.JournalNum));

    controller = new SrsReportRunController();
      controller.parmReportName('MyCustomReport.PrecisionDesign1');

    query = controller.parmReportContract().parmQueryContracts().lookup('
MyCustomReport_DynamicParameter');
    //Set parameter value;
    query.dataSourceNo(1).clearRanges();  
    query.dataSourceNo(1).addRange(fieldNum(
MyCustomReportView, JournalNum)).Value(dataTable.JournalNum);

    controller.runReport();

}

 


Reference:
http://xhellot.blogspot.co.id/

No comments:

Post a Comment