Page 1 of 1

How to create report filter with checkbox list

Posted: Mon Mar 07, 2022 3:33 pm
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

Re: How to create report filter with checkbox list

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

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

Thank you.

Re: How to create report filter with checkbox list

Posted: Fri Mar 11, 2022 12:00 pm
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!

Re: How to create report filter with checkbox list

Posted: Fri Mar 11, 2022 12:13 pm
by Lech Kulikowski
Hello,

You are welcome.