List Variable Items
List Variable Items
Hi, I have a list variable as part of a report and I'd like to be able display in a text box the value of the items in the list that have been checked on.
For example, my list variable gets its data from a database table and lists a series of Departments such as the ones listed below...
Parks
Roads
Water
Sewer
If a user only chose Parks and Water, I'd like to be able to display Parks and Water in a text box. Is there a way to determine which values in a list
variable have been checked on?
Thanks,
Carl
For example, my list variable gets its data from a database table and lists a series of Departments such as the ones listed below...
Parks
Roads
Water
Sewer
If a user only chose Parks and Water, I'd like to be able to display Parks and Water in a text box. Is there a way to determine which values in a list
variable have been checked on?
Thanks,
Carl
Re: List Variable Items
Hello,
You can use the following expression:
{VariableList.ToQueryString()}
Thank you.
You can use the following expression:
{VariableList.ToQueryString()}
Thank you.
Re: List Variable Items
Excellent Aleksey - Thank You!
Re: List Variable Items
Hello
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
We are always glad to help you!
Please let us know if you need any additional help.
Thank you.
Re: List Variable Items
Hello,
Example:
Key: 1 Value: Vehicles
Key: 2 Value: Fruits
Key: 3 Value: Vegetables
Key: 4 Value: Electronics
Using {VariableList.ToQueryString()} it displays keys (like 2,4) instead I would like the Values of list to be displayed (like Fruits, Electronics).
How can I display Values of the list and not keys? (I need to do it in designer)
Thanks & Regards,
Zalak
In my case, the list variable has key value pair
Example:
Key: 1 Value: Vehicles
Key: 2 Value: Fruits
Key: 3 Value: Vegetables
Key: 4 Value: Electronics
Using {VariableList.ToQueryString()} it displays keys (like 2,4) instead I would like the Values of list to be displayed (like Fruits, Electronics).
How can I display Values of the list and not keys? (I need to do it in designer)
Thanks & Regards,
Zalak
Re: List Variable Items
Zalak,
One possibility would be to make the keys the same as the values.
Carl
One possibility would be to make the keys the same as the values.
Carl
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: List Variable Items
Hello,
Unfortunately, no. That feature is not available for variables.
There is task in our to-do list.
Thank you.
Unfortunately, no. That feature is not available for variables.
There is task in our to-do list.
Thank you.
Re: List Variable Items
If the source for the variable was changed to Data Columns instead of Items and Zalak created a Datasource with Vehicles, Fruits, Vegetables, Electronics in a column
and then used that column for both the keys and values, it should work. I do it all the time for some of my reports.
Carl
and then used that column for both the keys and values, it should work. I do it all the time for some of my reports.
Carl
-
- Posts: 6266
- Joined: Tue Mar 20, 2018 5:34 am
Re: List Variable Items
Hello,
Thank you for the additional solution.
Thank you for the additional solution.
Re: List Variable Items
Hello Carl,cbrydon wrote: ↑Thu Aug 09, 2018 8:26 pm If the source for the variable was changed to Data Columns instead of Items and Zalak created a Datasource with Vehicles, Fruits, Vegetables, Electronics in a column
and then used that column for both the keys and values, it should work. I do it all the time for some of my reports.
Carl
Thank you for your reply. I had already tried with new datasource using {ID, Name} columns of datasource as {Key, Value}, but still the ToQueryString() gave me 1,2,3...
Any ways, in my case I could use IIF() statement to get the required result as the feature is not available.
Example: {IIF(Var == 1, "Vehicles", IIF(Var == 2, "Fruits", IIF(Var == 3, "Vegetables", IIF(Var == 4, "Electronics", "")))).ToString()}
I appreciate the help.
Thanks & Regards,
Zalak