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)
Sample report design with Java/javascript used in it
royaditya
<p>All,</p>
<p> I am very much newbie in BIRT. I did some sample start up reports but not sure where to write a javascript or java code to customize the report. Does anyone have any sample where there are some scripting involved. It would be very much helpful.</p>
<p> </p>
<p>Thanks,</p>
<p> </p>
<p>Andy.</p>
Find more posts tagged with
Comments
jfranken
<p>Hi Andy,</p>
<p> </p>
<p>When writing JavaScript to customize a report, first select the element you wish to customize. You can do that by clicking on it in the layout. You can also click the element on the Outline tab to select it. In addition, data sources, data sets, filters, data bindings, master page elements, etc. can all be customized with JavaScript. To select the report element itself in the layout, click a blank space outside of any elements that have been added to the report. For tables, you can select the table or select individual rows, columns, or cells. </p>
<p> </p>
<p>Once you have selected the element to be customized, click the Script tab. At the top of the scripting area, you will see a list of event handlers. Select the event where you want to place your code. You can write JavaScript in the events without having to add <script> tags. You can also import Java packages and write Java code in the events. </p>
<p> </p>
<p>If you click the Palette tab while you have the Script tab open, you will see built-in variables and functions that can be used in the script. The keyword "this" is usually available as a reference to the element. If you type "this." ("this" followed by a period), you will see a context sensitive popup menu that lists the methods and properties that are available for that element. For example, a label element has the property this.text. If you write the line of code: this.text = "test"; when you run the report, the label will display the word "test" inside the text box.</p>
<p> </p>
<p>Here are some useful links:</p>
<p><a data-ipb='nomediaparse' href='
http://developer.actuate.com/be/documentation/ihub3/help/adg/adg62/index.html#page/ADG/ScriptingWithJavaScript.1.01.html'>http://developer.actuate.com/be/documentation/ihub3/help/adg/adg62/index.html#page/ADG/ScriptingWithJavaScript.1.01.html</a></p>
;
<p><a data-ipb='nomediaparse' href='
http://www.eclipse.org/birt/documentation/integrating/scripting.php'>http://www.eclipse.org/birt/documentation/integrating/scripting.php</a></p>
;
<p> </p>
<p>I hope this helps get you started. Regards,</p>
<p>Jeff</p>
royaditya
<p>Thank you very much Jeff. Appreciate your response. Very much helpful.</p>
<p> </p>
<p>Best,</p>
<p> </p>
<p>Andy</p>