Sunday, March 29, 2015

Debugging a Dynamics AX2012 SSRS RDP Report


I haven't put my finger on it yet, but there are times when I am unable to debug an SSRS RDP Report.  I add my breakpoint but during code execution, the system just won't break when it should.  I believe this is related to how the classes are extended.

While faced with this delima, I did some research on the internet and found an article which shows how to create a job for debugging purposes.  Please follow this link for the original reference: Test Report Data Provider in AX2012.

The following is a simple job to invoke an SSRS RDP report.  It doesn't actually print the report, but it does do the meat of the processing so you can debug your RDP code.  Substitute your RDP class and Contract information as required.

static void Job3(Args _args){
TmpABC tempTable;
InventABCDP dataProvider = new InventABCDP();
InventABCContract contract = new InventABCContract();
contract.parmABCModel(ABCModel::Link);
contract.parmCategoryA(10);
contract.parmCategoryC(20);
contract.parmCategoryB(70);
contract.parmInterest(2.5);

dataProvider.parmDataContract(contract);
dataProvider.processReport();
tempTable = dataProvider.getTmpABC();

while
 select tempTable
{
info(tempTable.ItemName);
}
}

No comments: