Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Using Global Variables
jballnik
Hi Gang,
I'm displaying a set of data rows grouped by a field called TYPE, the group footer is displaying the count of records for that particular group. I have a condition where some of the data rows are visible but some are not and I want the footer to reflect the records that are visible.
So there might be 10 data rows that are returned, but I only want 5 to appear and I want the total count to say 5 not 10.
Are global variables available in BIRT where I can use a running count of the rows that are visible and use that in the footer? If so, would I do my calcuations in a Data control?
thanks,
John
Find more posts tagged with
Comments
bhanley
You can use a Global Persistent Variable in order to track data across different elements of the report. Using this should allow you to track anything you need throughout the report's lifecycle.<br />
<br />
Inside a scripting event handler, use the following:<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
reportContext.setPersistentGlobalVariable("var_name", value);
reportContext.getPersistentGlobalVariable("var_name");
</pre>
<br />
There are a number of posts and DevShare items detailing this feature to help you further.
mwilliams
Hi John,
If you declare a variable in the report initialize script like rowCount = 0, you can increment this variable in your visibility expression you have on your row in the condition that you don't hide the row. Then you can call this variable in a report element of your choice in your footer.
jballnik
Great...I got it to work. Thanks for all your help!!