Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Display Variable in Expression Box
jballnik
Hey Gang,
I've created a variable (totComplete) at the beginning of a report and populated it as the report is being executed. I want to display it at the end but can't figure out how to do it. I created a new Binding and placed the variable in the expression builder but nothing displays. Any ideas?
expression: totComplete;
Thanks,
John
Find more posts tagged with
Comments
mwilliams
Where did you create the variable? What was the initial value? And where did you populate it?
jballnik
Hey Mike,
I created the variable in the report initialize method:
var totOutstand = 0;
I populated it on the row of where the aggregate function was being displayed:
totOutstand = row["TOT_REQOUTSTAND"];
I put in some debug statements and its printing throughout the report but don't know how to display it at the end.
thanks,
mwilliams
Try removing the "var" to make the variable "global". If you set the value in the onCreate of the aggregation or table, then you should just be able to recall this in an expression builder for a dynamic text or data element. Let me know if you still have issues after doing this.
jballnik
It worked!!!! Thanks Mike!!!
Stefan Ueb
Hi,
i tried the same thing, initialized a variable "count" at report init, added some values and tried to display the value via data element.
When using a text element (value-of etc.) it works fine but when using a simple data element (expression is "count" without the "") then it displays only a 0.
Init:
count = 0;
onCreate of table:
count = count + row["ptA"]; // ptA is an aggregation
data element expression:
count;
mwilliams
Hi Stefan Ueb,
It may just not work with a data element because of order of execution. I just assumed in my answer above that it'd work in any expression. Can you recreate what you're doing with the sample database and post it in here and I'll see if I can get it to work in the data element?
If not, what is the reason that you can't use a text element?