Debugging SSRS Reports
If the Debugger will not break in your SQL Server Reporting Services Report and/or you want to speed up the debugging session by not printing the report and only stepping through the class logic, try the following steps:
- In the AOT under Tools > Options click the Development link and unmark the ‘Execute business operations in CIL’ checkbox
- Set breakpoints in the RDP class
- Manually invoke the RDP class via a job
-Take contracts which sets their parameters
-Have processReport methods which act as the driver method in the class
-In a job create code like the following:
//This is the temp table the RDP class populates and the one you want to view the contents of.
CustReportDP dataProvider = <strong>new</strong> CustReportDP();
//This is the RDP class used by the report
CustReportContract contract = <strong>new</strong> CustReportContract();
//This is the contract class used by the RDP class
//The parm methods are on the contract become the parameters for the report
dataProvider.parmDataContract(contract); //Send the contract to the RDP class
dataProvider.processReport(); //Execute the primary method in the RDP class
tempTable = dataProvider.getTmpABC();
//Get the populated temp table in order to view its contents.
//Every RDP class has a get method for each temp table it populates.
<strong>while</strong> <strong>select</strong> tempTable //View the contents of the table
With this approach any breakpoints in the RDP class will definitely get hit as the debugger will run on the client side just like a normal debugging client session. Using the job will completely bypass the SSRS report but you can debug your logic and simulate the report behavior by passing the appropriate parameters.