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)
Grouping + dynamic master page header
arvinghazarian
hi everyone,
I am totally new to Birt and I need your help!!
So, lets say i have reporting grouped by country and I would like to show the country name in the header of the master page. Every group is on a separate page, that means the header should change, when ever I go to next page.
thx in advance
Find more posts tagged with
Comments
arvinghazarian
<p>nobody can help
(((((</p>
kclark
<p>Take a look at my example that I've attached. First in the beforeOpen() of my data set I created an ArrayList()</p><pre class="_prettyXprint">array = new java.util.ArrayList();</pre><p>Then I stored the value I'm grouping on in this ArrayList in onFetch()</p><pre class="_prettyXprint">array.add(row["COUNTRY"]);</pre><p>Then in the afterClose() I removed all duplicated and sorted the list</p><pre class="_prettyXprint">hs = new java.util.HashSet();hs.addAll(array);array.clear();array.addAll(hs);Packages.java.util.Collections.sort(array);reportContext.setPersistentGlobalVariable("array", array);</pre><p>Now I can display the country/group in the master page header from the onRender() of a label</p><pre class="_prettyXprint">var array = reportContext.getPersistentGlobalVariable("array")this.text = array.get(pageNumber-1);</pre>