Monday, August 5, 2013

Unit Testing of SSRS Reports

1.    Background
The article describes how we can start the unit testing of SSRS reports. Unit testing helps us in finding bugs during development stage only. A good unit testing reduces re-work and provides good quality of deliverables.

2. Following are the things need to be check as part of SSRS report unit testing

  • Check the data source whether it is pointing to correct server name and database.
  • If data is not coming to Report and data source is correct then check the dataset for report layout whether you mapped the correct dataset to report layout or not.
  • If some of the columns of report is not showing data then check these columns are mapped to dataset or not. If mapped to dataset then see the Visibility property of the column. Make the visibility     property False.
  • If you are using grouping (to show grouped data), but report is not showing grouped data then checked grouped by expression is correct or not. Also see whether you are using Aggregate function for     Numeric column or not. For checking grouping expression you can go to Grouping pane just below the report.
  • If you are using colors (Red,Green,Blue) for showing some useful information and report is not showing correct information then check for the expression for colors in Textbox properties(Fill Tab).
  • When a Stored procedure (with input parameters) is giving some data in management studio but when we run the same SP in the Report with same parameters, report does not return any data. In this     case, we need to check whether parameter returning the same data for SP or not (Cases like format of datetime, SP accept ‘MM/DD/YYYY’ and Report parameter returns ‘DD-MM-YYYY’)
  • If your report has more than 65,000 records and you want to export the report in excel then while exporting to excel, SSRS will give error.  In this case, you need to use Page Break for every 65,000 records.     Reason- Excel 2003—does not accept more than 65,000 records in one sheet. By using Page Break, next 65,000 records will export into sheet2.
  • If you are not able to deploy the report then check whether you are deploying to correct URL or not. Correct URL is http://servername/reportserver
  • If you have subscribed a report for email but email is not coming then you need to check:
        * SSRS configuration Manager
        * Email configuration
        * Sender email address is there or not.
        * Also check SMTP server name is there or not.
  • If you subscribe a report for Windows share then check you have given UNC path (Network path). SSRS does not accept local path. Correct path should be like \\servername\sharedfoldername

No comments:

Post a Comment