Hi!
Lets say a report has a variable "Variable1" as defined in the attached screenshot. The "key" field of the variable is the unique identifier of a row and the "value" field is a user friendly description text. The variable is used as a input field (user requested) to filter the report through a parameter refering to the variable "Variable1". The report has a text component on top that shows the value of "Variable1" to show the selected filter to the user. The content of the text component is: {Variable1}. However it shows the "key" value of "Variable1", which is a number and is not very user friendly. Is there a way to access the more descriptive "value" field of the variable so that the user friendly description text will show?
For instance something like {Variable1.Value()}
Regards
Frode
Access the "value" field of a variable
Access the "value" field of a variable
- Attachments
-
- Variable_definition.jpg (58.01 KiB) Viewed 4090 times
Re: Access the "value" field of a variable
Hello,
Please send us a request on support@stimulsoft.com.
We investigate the possibility to add this feature for variables.
Thank you.
Please send us a request on support@stimulsoft.com.
We investigate the possibility to add this feature for variables.
Thank you.
Re: Access the "value" field of a variable
Ok, thank you for the reply! 

Re: Access the "value" field of a variable
Hello
We are always glad to help you!
Let us know if you need any additional help.
Thank you.
We are always glad to help you!
Let us know if you need any additional help.
Thank you.
Re: Access the "value" field of a variable
Hi again.
Found a workaround for the problem:
1. Created a new datasource "NewDataSource" and added a SQL query with a parameter with the keyvalue of the filter variable "Variable1" (the selected value in the dropdown list). The query will return the row representing the selected value in "Variable1" from the proper database table.
2. Then for the text component showing the selected filter, the expression is set to {NewDataSource.Description}. That did the trick.
It is a little cumbersome though, but it works. Would have been more easy and elegant if the variable object just exposed a property/function like "GetValue()". Then the expression of the text component would only be {Variable1.GetValue()}.
Regards
Frode
Found a workaround for the problem:
1. Created a new datasource "NewDataSource" and added a SQL query with a parameter with the keyvalue of the filter variable "Variable1" (the selected value in the dropdown list). The query will return the row representing the selected value in "Variable1" from the proper database table.
2. Then for the text component showing the selected filter, the expression is set to {NewDataSource.Description}. That did the trick.
It is a little cumbersome though, but it works. Would have been more easy and elegant if the variable object just exposed a property/function like "GetValue()". Then the expression of the text component would only be {Variable1.GetValue()}.
Regards
Frode
Re: Access the "value" field of a variable
Hello,
Thank you for the information about the workaround.
Thank you for the information about the workaround.