Accessing String List Variable

Stimulsoft Reports.WEB discussion
Post Reply
robert.andrews
Posts: 3
Joined: Mon Oct 08, 2018 9:05 am

Accessing String List Variable

Post by robert.andrews »

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?

Image

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.

Image
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Accessing String List Variable

Post by Lech Kulikowski »

Hello,

Please select DataSource property. When select Items it is possible to add only static values.

Thank you.
robert.andrews
Posts: 3
Joined: Mon Oct 08, 2018 9:05 am

Re: Accessing String List Variable

Post by robert.andrews »

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.
Thanks for that!

Is there a way to access the list of items in the variable with a simple CSV style output?
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Accessing String List Variable

Post by Lech Kulikowski »

Hello,

Sorry, maybe we did not exactly understand your question. Could you explain your issue in more details?

Thank you.
robert.andrews
Posts: 3
Joined: Mon Oct 08, 2018 9:05 am

Re: Accessing String List Variable

Post by robert.andrews »

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
Lech Kulikowski
Posts: 6247
Joined: Tue Mar 20, 2018 5:34 am

Re: Accessing String List Variable

Post by Lech Kulikowski »

Hello,

Unfortunately, only ToQueryString() method is available for the List Variables.

Thank you.
ianwelsh
Posts: 19
Joined: Mon Sep 25, 2017 1:54 pm

Re: Accessing String List Variable

Post by ianwelsh »

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.
HighAley
Posts: 8431
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Accessing String List Variable

Post by HighAley »

Hello.

Thank you for your solution.
Post Reply