How to create report filter with checkbox list

Stimulsoft Reports.WEB discussion
Post Reply
tausin
Posts: 6
Joined: Mon Mar 07, 2022 1:44 pm

How to create report filter with checkbox list

Post by tausin »

Dear support

I have created report with sql postgre datasource and I need to create any userfriendly filter for users.

I am able to create filter with textbox ( picture 1) - I created new variable pnps_id and then I put it into select: where my_data_id = @pnps_id. It works OK

but I want to create filter with select list (picture 2). - I created new variable but when I change type of variable from VALUE to LIST, checkbox "Alow as SQL parameter" is disabled.

is there any solution, how to create filter with checkbox list (picture 2) ?

Thanks
Attachments
02variable.png
02variable.png (135.64 KiB) Viewed 1830 times
01variable.png
01variable.png (182.27 KiB) Viewed 1830 times
Lech Kulikowski
Posts: 7334
Joined: Tue Mar 20, 2018 5:34 am

Re: How to create report filter with checkbox list

Post by Lech Kulikowski »

Hello,

You can use the following query:
select * from Products where CategoryID in {(var1.Count == 0 ? "('')" : "(" + var1.ToQueryString("'") + ")")}

Thank you.
Attachments
ListInQueryString.mrt
(9.61 KiB) Downloaded 228 times
tausin
Posts: 6
Joined: Mon Mar 07, 2022 1:44 pm

Re: How to create report filter with checkbox list

Post by tausin »

Lech Kulikowski wrote: Mon Mar 07, 2022 10:14 pm Hello,

You can use the following query:
select * from Products where CategoryID in {(var1.Count == 0 ? "('')" : "(" + var1.ToQueryString("'") + ")")}

Thank you.
:P Thank you, it works!
Lech Kulikowski
Posts: 7334
Joined: Tue Mar 20, 2018 5:34 am

Re: How to create report filter with checkbox list

Post by Lech Kulikowski »

Hello,

You are welcome.
Post Reply