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 BAR graph with java code
Abhijit Mandal
<p>Hello,</p>
<p> </p>
<p> </p>
<p>I am trying to create a BIRT Report having bar graph.</p>
<p>where i use java code and birt api with scripted dataset and able to get a bar graph.</p>
<p>every thing is fine if i do not give complex condition in Y axis.</p>
<p> </p>
<p>for example :</p>
<p>i want all "State" which are "closed" according to my data which i get from LIST of hashmap.</p>
<p>and i wrote some code like</p>
<p> </p>
<p>if(entry.getKey().equalsIgnoreCase("State")) {<br>
<br>
String val=" var a=0; if(row[\""+entry.getKey()+"\"]==\"CLOSED\")\n{a=1;}a;";</p>
<p>
<br>
Query query2=QueryImpl.create(val);<br>
bs.getDataDefinition( ).add( query2);<br>
<br>
<br>
cs.setDataType( "string" );<br>
<br>
<br>
}</p>
<p> </p>
<p>here val value is -->>var a=0; if(row[<span style="color:#ff0000;">"State"]</span>=="CLOSED")<br>
{a=1;}a;</p>
<p> </p>
<p>,BIRT does not take this string in Y axis but if i give as</p>
<p> </p>
<p> var a=0; if(row[<span style="color:#ff0000;">State</span>]=="CLOSED")<br>
{a=1;}a;</p>
<p> </p>
<p>Then the String is properly refleted to Y axis.</p>
<p>can any one say me what is going wrong.</p>
<p> </p>
<p> </p>
<p> </p>
Find more posts tagged with
Comments
There are no comments yet