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)
birt crosstab get data from dataset
AhmedAlaa
<p>i want to make a global variable which get the data from a column in the dataset<br>
and use this global variable in a crosstab report.</p>
<p> </p>
<p>i defined a new variable and set this variable as a global variable, using below code</p>
<p> </p>
<p>var naturalcolor;<br>
reportContext.setPersistentGlobalVariable("naturalcolor",dataSetRow["natureColor"]);</p>
<p> </p>
<p>then i use the ( naturalcolor ) in the measure value of the crosstab</p>
<p> </p>
<p> </p>
<p>importPackage(Packages.java.lang);<br>
reportContext.getPersistentGlobalVariable(naturalcolor);<br>
if ( measure["Value1"] != null ){<br>
this.getStyle().backgroundColor = naturalcolor;<br>
}</p>
<p> </p>
<p>but i think that the report doesn't seem to read the global variable as the value didn't change it's background color.</p>
<p> </p>
<p>Any Help Please ??!!!!<br>
</p>
Find more posts tagged with
Comments
pricher
<p>Hi,</p>
<p> </p>
<p>The best area to script for crosstabs is on the onCreate method of the crosstab itself. From there, you can choose between the onCreateCell or onCreateCrosstab function to dynamically change the behavior of your crosstabs.</p>
<p> </p>
<p>The following article gives a good introduction to the API available at the crosstab level: <a data-ipb='nomediaparse' href='
http://birtworld.blogspot.fr/2010/02/birt-crosstab-scripting.html'>http://birtworld.blogspot.fr/2010/02/birt-crosstab-scripting.html</a></p>
;
<p> </p>
<p>As well, I have attached a quick example that shows how to change the background color of a cell by scripting the above mentioned method.. The color information is saved in a persistent global variable set in the beforeOpen method of the data set.</p>
<p> </p>
<p>Hope this helps,</p>
<p> </p>
<p>P.</p>
<p> </p>