Choosing filters to apply

Stimulsoft Reports.NET discussion
yuns
Posts: 9
Joined: Wed Feb 07, 2024 3:43 am

Choosing filters to apply

Post by yuns »

Hi

Is there a way to create multiple filters but allow users to choose which filter to apply at runtime (Preview)?
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Choosing filters to apply

Post by Lech Kulikowski »

Hello,

You can use the Request From User variables for this task.

Thank you.
yuns
Posts: 9
Joined: Wed Feb 07, 2024 3:43 am

Re: Choosing filters to apply

Post by yuns »

Hi,

What I meant was I have 2 filters that is set to "Request from User"
However, is there a way to allow user to choose which filter to use when previewing the report, without having to check and uncheck "Request from User"
Screenshot 2024-02-08 133829.png
Screenshot 2024-02-08 133829.png (5.83 KiB) Viewed 657 times
For example.
For an instance, i would like to filter using ONLY hire date range,
Another instance, I would like to filter using ONLY Cess Date,
Another instance, I would like to filter using BOTH
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Choosing filters to apply

Post by Lech Kulikowski »

Hello,

You can add additional boolean variables that will apply only the necessary filters.

Thank you.
yuns
Posts: 9
Joined: Wed Feb 07, 2024 3:43 am

Re: Choosing filters to apply

Post by yuns »

Hi Lech,

Thank you for your quick response.

I'm quite new to stimulsoft and still trying to figure things out.

I tried to create a boolean variable but I can't seem to change the Key value. It will always be defaulted to false
Screenshot 2024-02-14 134929.png
Screenshot 2024-02-14 134929.png (7.19 KiB) Viewed 608 times

And I am not sure how to write the expression to retrieve the boolean value

is it

Code: Select all

 {bool_variable[0]? "true" : "false"}
But this code doesn't seem to work
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Choosing filters to apply

Post by Lech Kulikowski »

Hello,

You can add additional variables, and you use the following expression:
{ApplyFilter && HireDateRange}

Thank you.
Attachments
Screenshot 2024-02-14 102612.png
Screenshot 2024-02-14 102612.png (10.94 KiB) Viewed 597 times
yuns
Posts: 9
Joined: Wed Feb 07, 2024 3:43 am

Re: Choosing filters to apply

Post by yuns »

Hi Lech,

I am able to create 2 boolean variables
However, in the filter section, I wrote these 2 expressions
MultipleFilter.png
MultipleFilter.png (20.48 KiB) Viewed 526 times
When I tried to preview the report, I have to tick both checkbox for my report to display data because i'm using the AND operator in the filter screen
I tried the OR operator, but when I tick both checkbox, it applies both expression separately. (Means records that meet the hire date range criteria ONLY, and records that meet the cessation date range criteria ONLY)

This doesn't give the user the flexibility to choose either 1 or 2 filters to apply
PreviewMultipleFilter.png
PreviewMultipleFilter.png (6.43 KiB) Viewed 526 times
For example.
If I ONLY tick Hire Date, my data should apply the hire date range ONLY
If I tick Hire Date and Cessation Date, my data should only show records that meets BOTH the Hire Date Range and Cessation Date Range critieria.
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Choosing filters to apply

Post by Lech Kulikowski »

Hello,

Please send us a sample report with test data that reproduces the issue for analysis.

Thank you.
yuns
Posts: 9
Joined: Wed Feb 07, 2024 3:43 am

Re: Choosing filters to apply

Post by yuns »

hi Lech,

Where can I get test data? is there a document I can follow to create this sample report?
Lech Kulikowski
Posts: 6271
Joined: Tue Mar 20, 2018 5:34 am

Re: Choosing filters to apply

Post by Lech Kulikowski »

Hello,

You can use the Embed All Data to resources option.

Thank you.
Attachments
Screenshot 2024-02-20 232905.png
Screenshot 2024-02-20 232905.png (37.28 KiB) Viewed 473 times
Post Reply