Tuesday, December 17, 2013

Ax 2012 - Debugging SSRS Data Provider

Currently putting a breakpoint in a data provider will not activate the debugger.
For debugging the data provider class you must simulate running the report with a job:

// job for debugging SSRS report data provider - SPLCustObligoDP
static void SPLDebugSSRSReport(Args _args)
{
    // call report objects
    SPLCustObligoController  controller = new SPLCustObligoController();
    SPLCustObligoDP dataProvider = new SPLCustObligoDP();
    SPLCustObligoContract contract = new SPLCustObligoContract();

    // call report query
    controller.parmReportName(ssrsReportStr(SPLCustObligo,Report));
    controller.prompt();

    // transfer parameters to contract
    contract.parmPerDate(str2Date("18/11/2013",123));

    // transfer contract to dp
    dataProvider.parmDataContract(contract);

    // transfer input query to dp
    dataProvider.parmQuery(controller.SPLGetfirstQuery());

    // run processing
    dataProvider.processReport();

}

// SPLGetFirstQuery on controller
Query SPLGetfirstQuery()
{
    return this.getFirstQuery();

}

Notice! 
- You must transfer the parameters to the Contract manually even if you entered them on the input window. 
- The actual report won't appear. Only the data provider will run.

No comments:

Post a Comment