Accessing String List Variable
-
- Posts: 3
- Joined: Mon Oct 08, 2018 9:05 am
Accessing String List Variable
Hi
I have created a String List variable that users will use to filter the returns of data. Is there a way I can use this with the SQL Select statement to do some server side limits as opposed to all client side (Currently using the databand filter)?
Is there a way to display the contents of this variable similar to ToQueryString() without the escaping?
Finally, when trying to map the items in the list via Items, it doesnt seem to work for any Data Sources, see below for an example.
I have created a String List variable that users will use to filter the returns of data. Is there a way I can use this with the SQL Select statement to do some server side limits as opposed to all client side (Currently using the databand filter)?
Is there a way to display the contents of this variable similar to ToQueryString() without the escaping?
Finally, when trying to map the items in the list via Items, it doesnt seem to work for any Data Sources, see below for an example.
-
- Posts: 6261
- Joined: Tue Mar 20, 2018 5:34 am
Re: Accessing String List Variable
Hello,
Please select DataSource property. When select Items it is possible to add only static values.
Thank you.
Please select DataSource property. When select Items it is possible to add only static values.
Thank you.
-
- Posts: 3
- Joined: Mon Oct 08, 2018 9:05 am
Re: Accessing String List Variable
Thanks for that!Lech Kulikowski wrote: ↑Wed Oct 10, 2018 7:24 am Hello,
Please select DataSource property. When select Items it is possible to add only static values.
Thank you.
Is there a way to access the list of items in the variable with a simple CSV style output?
-
- Posts: 6261
- Joined: Tue Mar 20, 2018 5:34 am
Re: Accessing String List Variable
Hello,
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?
Thank you.
-
- Posts: 3
- Joined: Mon Oct 08, 2018 9:05 am
Re: Accessing String List Variable
The options that a user may have selected within the List, is there a way to display those on the page as feedback to the user?
Using ToQueryString() on the variable name is close to what I need however it also applies some escaping to the values.
Thanks
Using ToQueryString() on the variable name is close to what I need however it also applies some escaping to the values.
Thanks
-
- Posts: 6261
- Joined: Tue Mar 20, 2018 5:34 am
Re: Accessing String List Variable
Hello,
Unfortunately, only ToQueryString() method is available for the List Variables.
Thank you.
Unfortunately, only ToQueryString() method is available for the List Variables.
Thank you.
Re: Accessing String List Variable
This may or may not help:
due to how we've integrated this into our software, our "choose one or more" options are passed to the report as a single string variable, with the selected options comma delimited. The passed options would be ID values.
We then use the following in the WHERE clause:
@map_ids = '' OR CHARINDEX(','+CONVERT(VARCHAR,maps.id)+',',','+@map_ids+',')>0
Variable: map_ids ("Allow using as a SQL parameter" = true, string/value)
Database Table/Index: Maps / ID
Hope that makes sense and helps.
due to how we've integrated this into our software, our "choose one or more" options are passed to the report as a single string variable, with the selected options comma delimited. The passed options would be ID values.
We then use the following in the WHERE clause:
@map_ids = '' OR CHARINDEX(','+CONVERT(VARCHAR,maps.id)+',',','+@map_ids+',')>0
Variable: map_ids ("Allow using as a SQL parameter" = true, string/value)
Database Table/Index: Maps / ID
Hope that makes sense and helps.
Re: Accessing String List Variable
Hello.
Thank you for your solution.
Thank you for your solution.