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)
Calling global variable on main table doesn't work
AlbertYu
Hi,
Just wondering why my call to a global variable via the command:
reportContext.getPersistentGlobalVariable(BirtStr.concat(row["APP_COMPID"], "deployed"))
does not work.
I have set this global variable on the onCreate script of a sub table's row element script, by the following:
reportContext.setPersistentGlobalVariable(BirtStr.concat(row["APP_COMPID"], "deployed"), "show");
When I try calling this command on a sub-table's column, it works fine.
It just doesn't work when I try calling it on the main table's row.
The sub-tables are linked to the main table through a data set parameter binding - the parameter being Focus_App_CompID and the value being row["APP_COMPID"]
Can anyone help please?
Thank you,
Albert
Find more posts tagged with
Comments
johnw
They are at two different points in the report generation cycle.
You can't really have a child tables value show in the parent row. Not sure why you would need to, why not just display the child tables value.
If you really need to, a better way would be to have a hidden table at the top that sets a global map with the value you want. This is done in the onFetch method of the data set. This way, your not executing a query for every row in the table, you only execute two queries for the report, one that drives the map, and the main one. In the main table, I just pull the map and lookup the value based on the key.
I have attached an example. In it, you can see that the global variable will never be the correct value in your current row if set in the sub-table.
AlbertYu
Thank you kindly for your response johnw.
If it is not too much trouble, could you please provide the example in v2.5.0 BIRT Report Designer format?
My workplace only runs v2.5.0 at the moment. Very behind I know.
We are scheduling an upgrade to our software at the moment though...
Thanks and regards,
Albert
mwilliams
Here's the same report, without some styling, in 2.5.0.