Variables/calculated columns not working
Posted: Mon Nov 02, 2020 10:39 am
Hello there!
We try to display values in a table column based on a field in the data source table, something like this:
Left("XXXXXXXXXXXXXXXXXXXX",SalesPerCategories.Level)
Depending on the value in the field (e.g. 1, 2 or 3), the result should be either "X", "XX" or "XXX".
If we put the expression directly into the text field meant to display the value (with enclosing brackets {} of course), an object error is yielded, whereas an explicit use of a number e.g. {Left("XXXXXXXXXXXXXXXXXXXX",2)} works, but doesn't get us the results we require.
Now if we put the expression into a variable as shown in the screenshot, the expression is interpreted correctly... but only at design time, in the preview window (the designer uses the Java version as far as we understand). However, once we fill the report with actual data via .Net, the expression apparently cannot be interpreted. It's no different with a calculated column. Is this a bug in the Stimulsoft software? How would you explain the differing behavior?
And, most importantly: What would you recommend in a case like this? If we want to display fields based on expressions, where should we put it?
Thanks in advance,
Artimidor
We try to display values in a table column based on a field in the data source table, something like this:
Left("XXXXXXXXXXXXXXXXXXXX",SalesPerCategories.Level)
Depending on the value in the field (e.g. 1, 2 or 3), the result should be either "X", "XX" or "XXX".
If we put the expression directly into the text field meant to display the value (with enclosing brackets {} of course), an object error is yielded, whereas an explicit use of a number e.g. {Left("XXXXXXXXXXXXXXXXXXXX",2)} works, but doesn't get us the results we require.
Now if we put the expression into a variable as shown in the screenshot, the expression is interpreted correctly... but only at design time, in the preview window (the designer uses the Java version as far as we understand). However, once we fill the report with actual data via .Net, the expression apparently cannot be interpreted. It's no different with a calculated column. Is this a bug in the Stimulsoft software? How would you explain the differing behavior?
And, most importantly: What would you recommend in a case like this? If we want to display fields based on expressions, where should we put it?
Thanks in advance,
Artimidor