How to Add Runtime Filtering to Your .NET Report Application
Tags: webdev, devops, dotnet, tutorial
Published: 2023-06-22 20:08:37

---
canonical_url: https://developer.mescius.com/blogs/how-to-add-runtime-filtering-to-your-net-report-application
description: Learn how to add runtime filtering features to your .NET report application. See more from ActiveReports.NET today.
---
Hey everyone! Today we’ll be going over a quick example of how to add runtime filtering to your report using the Apply Parameters feature in ActiveReports 17.1\. As you might guess from the name “Apply Parameters”, this action will set parameters for the report when something is clicked. In our example, this will be a textbox.

For this guide, we’re going to start with a report that already has parameters set up to be concise. If you’d like to follow along, you can download the version we’ll be starting with, the completed version, and the [data source](/{localLink:umb://media/c357a02b302f4f2aacff9d3768745193} "ApplyParameters_AR_06/09/23") we’re using.

Note: You will need to adjust the path to the data source to match its location on your system if you use our sample.

If you’d like to learn more about creating parameters, we recommend checking out this blog as well: [How to Add a Parameter to your Report | ActiveReports](https://developer.mescius.com/blogs/how-to-add-a-parameter-to-your-report-activereports)

When completed, our example will look something like this where clicking on each textbox will toggle its corresponding category, adding or removing that category from the displayed data:

![.NET Report Filtering](https://files.grapecity.com/gc-website-media/lhnospqo/01-designer.gif?width=407.7448747152619&height=500)

### Create Something for Users to Click on to Apply Parameters

In the example, we will create a table of checkboxes/textboxes that automatically populates a row for each parameter in the parameters data set.

1\. Add a table with two columns.

2\. Add a checkbox to one column and a textbox to the other.

3\. Set the textbox to the value of your parameters field.

*   In the example, it will be: **=Fields!CategoryName.Value**

4\. Link the checkbox to the state of your parameters.

*   In the example, we can use: **=IndexOf(Parameters!Categories.Value, Fields!CategoryName.Value)>-1**

If you’re following along with the example, it should look something like this:

![.NET Report Filtering](https://files.grapecity.com/gc-website-media/nqhpassq/02-runtime.png?width=500&height=206.2228654124457)

### Add the Apply Parameters Action

In the example, we’ll add the Apply Parameters action to the textbox in our table. Soon, it will be possible to add an action directly to a checkbox control which will circumvent the need to have a textbox at all, but for now, we’ll be doing it this way.

1\. Select the textbox.

2\. In the Misc section of the properties panel, find “Action” and click the “…” button to open the action dialog.

![.NET Report Filtering](https://files.grapecity.com/gc-website-media/maun2hjz/03-runtime.png?width=249&height=130)

3\. Under “Action Type” select “Apply Parameters”

![.NET Report Filtering](https://files.grapecity.com/gc-website-media/vytnxpwy/04-runtime.png?width=466&height=183)

4\. In the “Parameters” table, set the name to the parameter you want to adjust with the action.

*   In the example, we’ll set the “Type” to “Toggle” since we are using a multi-value parameter
*   Then we’ll set the value to **=Fields!CategoryName.Value** to grab the same parameters that we’re setting to our textbox

![.NET Report Filtering](https://files.grapecity.com/gc-website-media/kd1gr2h1/05-runtime.png?width=465&height=99)

That should be it! If you follow the example, it should function the same as it does on our end. If you have any questions, please feel free to ask in the comments below, and we will be happy to address them!