Generating reports in SSRS take a lot of time, especially if the CRM is hosting huge bulk of data. Sometimes, clients would only like to see and choose a few records for the report. In this case, they create a dropdown list. However, this is still inefficient as the dropdown will first load the bulk data (say 80,000 records as an example) before you could completely select the records you want to show on the report. In addition, you have to scroll down all the way to the bottom, one by one, to see the record you’re looking for. Worst part is the user is likely to experience lag due to massive request and loading of records.

As this provides UI and performance issues, there is a need to filter the dropdown list. When a user types a sample word, it should provide short number of filtered results in the dropdown to make a seamless user experience in searching and establishing reports. Here’s how to do it.

Base Instruction

  1. Given that there is a parameter for dropdown list of all Contact records, add another parameter and name it FilteredContact. (Note: Name should contain no spaces. Only prompt can accept spaces as this is the one being displayed on the report).
  2. Check the Allow the null value option and choose Visible option under visibility parameter.

filtering bulk data

 

  1. Leave the other tabs untouched and click OK.
  2. Go and right click the Contact Dataset and click Dataset Properties.

dataset properties

Approach 1: OOTB SSRS Filter functionality

  1. Go to Filter Click Add button.

dataset properties 2

 

  1. Add fullname field in the Expression. Set the Like in the expression for the wildcard. Click the fx button for the value to set custom value.
  2. On the expression value, append and prepend the character “*” to the FilteredContact. This serves as a wildcard that will search for any character occurrences before and after the parameter. Click OK button.

expression value

 

  1. Please take note that the parameter should be in order to avoid errors. The filter parameter should come first before the parameter that populates all the contact record. SSRS executes the parameter in sequence based on priority. Since the list of contacts is dependent to the filter parameter, it should go after the filtered contact.

report data

Approach 2: Filter by Query (Fetch XML)

  1. Click Parameters. Click Add button.

dataset properties 3

 

  1. Set the parameter name to @FilteredContact and select the Filtered Contact as parameter value. Click the fx button for the value to set custom value.

dataset properties - filtered contact

 

  1. On the expression value, append and prepend the character “%” to the FilteredContact This serves as a wildcard that will search for any character occurrences before and after the parameter. Click OK button.

dataset properties expression value

 

  1. Add fullname condition to the Fetch XML query and set the assigned @FilteredContact to the value.

filteredcontact fetchxml

Testing

  1. Set value to the filtered contact parameter. The active contacts should now have short list of all contacts with the same occurrences with the filtered value.

testing 1

 

  1. If the filtered contact is blank or null, the active contact should show all the contact records.

testing 2