How can I troubleshoot "#Error" returned in fields populated by expressions containing custom code?

Answered How can I troubleshoot "#Error" returned in fields populated by expressions containing custom code?

  • Tuesday, November 27, 2012 12:15 AM
     
     

    Does anyone have specific suggestions for troubleshooting custom code in SSRS reports?

    All of our reports in Reporting Services use a custom function to display header/footer information. Our test environment just suffered a major hardware failure, and when we rebuilt it, we stopped seeing the values we expected in the report headers, instead seeing "#Error" in each location. The main body of the report is fine.

    I downloaded a sample RDL from Reports Manager, opened it in Visual Studio, tried to use the Preview function and got these errors:
    --[rsRuntimeErrorInExpression] The Value expression for the textbox ‘txtReportSubtitle’ contains an error: Object reference not set to an instance of an object.
    --[rsRuntimeErrorInExpression] The Value expression for the textbox ‘txtClientName’ contains an error: Object reference not set to an instance of an object.
    --[rsRuntimeErrorInExpression] The Value expression for the textbox ‘txtPrinted’ contains an error: Object reference not set to an instance of an object.

    I've compared everything I could think of between the test and live servers (live still works fine) and checked as many IIS and Report Services log files as I could find. The custom code is supposed to call a stored procedure to obtain the header/footer information, so I ran a Profiler trace and confirmed that that procedure is not being run. Also,when I run the procedure in Management Studio, it returns the expected results. This makes me think there is an issue with the custom code.

All Replies