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)
Set binding value to page variable
BenRivet
Hi,<br />
<br />
I have a report that dynamically inserts report items that are fetch from a library.<br />
<br />
In the footer of the master page of the main report, I display the content of a page variable (called footnote).<br />
<br />
for each of my report items (they are all grids) that are in my library, inside the "onPageBreak" event, I have something like this :<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.setPageVariable( "footnote", "this is a footnote for item x" );</pre>
<br />
Up to now, everything I specified works.<br />
<br />
What I want to do is to assign my page variable to the result of a data binding column. (the binding is defined on the report item)<br />
<br />
I have tried assigning the page variable using the getRowData, but it doesn't seem to work.<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>reportContext.setPageVariable( "footnote", this.getRowData().getColumnValue( "indexName" ) );</pre>
<br />
I have attached a print screen to help visualize my description.<br />
<br />
<br />
How can I solve this ? Thank you !
Find more posts tagged with
Comments
Clement Wong
Ben,<br />
<br />
Page variables are evaluated at render-time not at run-time. So getting the column indexName at render time in the code you posted will not work as you expect.<br />
<br />
You will need to either use a global variable and assign the indexName value to it. Then, you can use the global variable in the onPageBreak method.<br />
<br />
Or you can name a given element, and then reference its value in a page script from within the onPageBreak method.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/org/devshare/designing-birt-reports/1247-page-totals-using-page-variables/'>This
BIRT Exchange DevShare article</a> will explain the two methods.
BenRivet
Hello Clement,
Thank you VERY much for your post! Great help !
I did one test and looks like it works the way I want !