- Home
- DevShare
- Forums
- Wiki
- Products & Services
- Downloads
- Documentation
- Webinars
- Store
- Blog
Building web 2.0 style functionality into your BIRT report may be easier than you think. Web 2.0 requires client side javascript code, and interaction with the actual report elements after the report is generated. BIRT provides a very easy to use mechanism to enable your javascript code, direct access to any report element present in your report, and with a little bit of Javascript magic, you can provide a rich experience your users have always dreamed of.
The secret weapon to web 2.0 enabling your reports is the "Bookmark" property present on every single report item, table cell, table row, and even entire tables themselves. Even better is this property is an actual expresison evaluated at run time, where you can leverage global variables, and data items as part of the Bookmark name. What this proprety does is create an ID attribute on the output HTML element for the given report item. Once you have an ID attribute on the output, getting a handle on it is done with a single line of Javascript code:
document.getElementById(bookmarkName);
To output "data driven" javasript code, you would make use of the Text Item element, with a format set to HTML. Type up your javascript code inside of standard <script> tags. To data drive this code, you would make use of a special tag called "value-of" Anything contained wihtin this tag is evaluated like any other expression wihtin the context of a BIRT report. So to call a javascript function based on a ID column that is part of the dataset, the contents of your Text Item would be similar to this:
<script>
myCustomJavascriptFunction("
</script>With bookmarks setup to use the same ID column from the row as part of the bookmark name, you can now get a handle on individual elements of that record, do some Javascirpt / DHTML Web 2.0 style interaction with it, and give your users that complete rich internet application experience they require, all done within the context of a report.
Posted: Oct 21, 2007 1:57:31
RojoPosted: Mar 14, 2008 19:06:15
Yes, pleas add a report example.
|
Posted: Mar 26, 2008 6:12:39
Site Map | Terms & Conditions | Privacy Statement | Contact Us
BIRT Exchange is a community site for Eclipse BIRT and Actuate BIRT developers who are adding reporting, analytics and business intelligence capabilities to Java applications. BIRT Exchange allows developers to share code samples and report designs, tutorials, technical articles, as well as tips and tricks. BIRT Exchange also offers forums, downloads, online documentation, and information on BIRT technical support.

(0 reviews, 11119 views)