In this article we will review how to use parameters to filter queries for rdlx reports as the process is different from section reports.
First you will need to determine the data source. Not all datasets are query-able so verify before continuing. The data source is the base layer data object on the report and you can then make the datasets based on said data source.
Next is the process of making the parameters themselves as we will need them when we go to make the dataset and use them in the filtering of the dataset. First determine the type of parameter needed and how many.
The parameter creation will be different depending on what you need, but a suggestion for if you are doing a parameter that has Available values based on the dataset is to have a small dataset just to feed the parameters that is not filtered unless by cascading parameters.
Once the parameters are created you will need to make the dataset that will have the filtered query. To start, the dataset dialog will have an area to make Dataset Parameter. This is the location where you will relate the report parameters to the dataset. Thus allowing us to pass the report parameter into the dataset parameter which is what will be in the final query allowing for query filtering.
The central idea of doing this whole process is to limit the amount of data that needs to come over to AR/your project. This will reduce time and RAM usage when working with the final report vs if you did a filter at the report level. As these queries happen on the database, which will optimize what is being sent out to only what we ask for based on the clauses of the query.
In review here are the steps needed.
- Have a database that can have read queries sent and executed on it. SQL etc
- Have a report to then make a data source connected to said database.
- Make parameters on report
- Make dataset object and then place query in it along with dataset parameters relating what will be in the query to the report parameter. (can be named the same.)
If done correctly a change in the parameters will change the report data. If not please verify the parameters are working correctly and are being feed to the query via Dataset parameters. This is the step that is looked over the most.
Victor Stahlman