Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
Add dynamic chart title based on report Parameter
vishalkp
<p><span style=""color: #0000ff;""><span style=""color: #0000ff;""><font color=""#0000ff""><font color=""#0000ff"">
<p><!-- / icon and title --><!-- message -->
<div id=""post_message_48074"" style=""overflow: auto; width: 884px; height: 1014px;""><span style=""font-size: small; font-family: arial,helvetica,sans-serif;""><em>Hello,<br /><br />Actually there are different ways to display the chart heading based on selected report parameter depending upon which version of BIRT you are using?<br />which type of chart you are using (simple chart in BIRT2.1/2.2/2.3 or flash chart in 2.3)?<br /><br />The reason behind this is that flash chart has no script, so if you want to display chart heading based on selected report parameter in <br /><br />[1.] flash chart follow steps as:<br /><br />1. In chart's Format Tab, Hide title by unchecking Title. Click on Outline tab, then report_name.rptdesign and click on the script tab and select initailize Event from the dropdown seen above.<br /><br />2.Add script as:<br /><br />reportContext.setPersistentGlobalVariable(""Parameter_name"",params[""Parameter_name""].value);<br /><br />3. Then add a label to your report above your chart. leave it blank, just change its size, font as required.<br /><br />4. Click on the label and then on script and select onPrepare event from dropdown above.<br /><br />5. Add script as:<br /><br />var s = reportContext.getPersistentGlobalVariable(""Parameter_name"");<br />if(Parameter_name!=null)<br />{<br />this.text='Consignment Value by Facilities of BU: '+s<br />}<br />else<br />{<br />this.text=' ';<br />}<br /><br />thats all, and it will work...<br /><br /><br />[2.] Normal Charts:<br /><br />1. Show Title by Checking the Title in chart's format. leave the title text box blank.<br /><br />2. click on the chart and then on script. select onRender event from dropdown and add script as:<br /><br />function beforeGeneration(chart, icsc)<br /><br />{<br /><br />var title = 'Consignment Value by Facilities of BU: '<br /><br />title = title+ icsc.getExternalContext().getScriptable().getParameterValue(""parameter_name"")<br /><br />chart.getTitle().getLabel().getCaption().setValue(title)<br /><br />}<br /><br /><br />thats all, and it will work...<br /><br />I think you will get through this.<br /><br />Do reply if any queries.<br /><br />With Regards,<br />VishalKP.</em></span></div>
</p>
</font></font></span><font color=""#0000ff"">
<p> </p>
</font></span>
<p> </p>
</p>
<p>
<p><span style=""font-size: x-small; color: #0000ff;""></span></p>
</p>
Find more posts tagged with
Comments
There are no comments yet