Page 1 of 1

Referencing Data Fields in Variables

Posted: Fri Mar 07, 2014 3:33 pm
by sbd_jeff
Hi Stimulsoft,
I am attempting to render several fields within label using a variable. I'm attempting this because the variable name will always be the same, versus the label name having a potentially different name.

For example, if I have a datasource "Transactions" with 6 fields:
- Date
- Item
- Item Description
- Cost
- PersonID
- PersonName

I am able to render any number of fields in the group header label using {Transactions.Item} - {Transactions.Description}.
But, If I create a variable of type string using a value type of Expression named "GroupLabel" and set the expression to "Transactions.Item", nothing is shown. If I set the Expression to "Transactions.Item + "B"", only the "B" character is shown.

Is it possible to render data fields within variables?
If so, how?

Thanks.

Re: Referencing Data Fields in Variables

Posted: Mon Mar 10, 2014 6:19 am
by Alex K.
Hello,

Can you please send us your report with test data which reproduce the issue for analysis.

Thank you.

Re: Referencing Data Fields in Variables

Posted: Wed Apr 02, 2014 11:39 am
by sbd_jeff
I am very sorry for the delay in responding.
I have attached an example that illustrates the issue I am having.
There are two columns: Products.UnitPrice and Products.UnitsInStock

If I create a simple text expression with a value of:

Code: Select all

{Products.UnitPrice * Products.UnitsInStock}
I get the expected result (ex. 2 * 3 = 6)

If I create a variable ("TotalValue" in the sample), and attempt to do the same thing:

Code: Select all

Products.UnitPrice * Products.UnitsInStock
I always get 0.

Am I doing something wrong?

Thanks!

Re: Referencing Data Fields in Variables

Posted: Thu Apr 03, 2014 6:51 am
by HighAley
Hello.

Please, try to set Read Only option of the variable.
Then the expression will be calculated on each request.
You could read more information about this option on the User Manual.

Thank you.

Re: Referencing Data Fields in Variables

Posted: Thu Apr 03, 2014 11:44 am
by sbd_jeff
Thank you for the clarification Aleksey. Works like a champ!

Re: Referencing Data Fields in Variables

Posted: Fri Apr 04, 2014 2:48 am
by Andrew
Hello,

Thank you and have a nice day!