On April 27, 2024, our Sign-in and Create Account options will be unavailable from 9am-12pm ET. During this maintenance window, developer account access and free trial registration will be unavailable.
Web 2.0 and BIRT
PuckPuck
Junior Member
<p><font size="3" face="Verdana, Geneva, Arial, Helvetica, sans-serif">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.<br /><br />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:</font><br /><br /><font face="Courier New, Courier, monospace"><font size="3" face="Courier New, Courier, monospace">document.getElementById(bookmarkName);</font></font><font face="Times New Roman"><br /><font size="3" face="Verdana, Geneva, Arial, Helvetica, sans-serif">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:</font><br /><br /><font size="3" face="Courier New, Courier, monospace"><SCRIPT><br />myCustomJavascriptFunction("<value-of>row["ID"]</value-of>");<br /></SCRIPT></font></font><font size="3" face="Verdana, Geneva, Arial, Helvetica, sans-serif">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.</font></p>
Categories
- All Categories
- Cloud Editions
- 1 Thrust Services
- cat as link
- 1 Core SaaS Application development
- 10 Developer Announcements
- 15 General Questions
- 33.4K TeamSite
- 141 Application Governance & Archiving
- 15.2K Designing Analytics Reports
- 1K DevShare Downloads
- Core SaaS Applications
- nested parent
- 4.3K Developing Analytics Applications
- 8.8K Documentum Developer Forum
- Media Management developer
- 159 Transactional Content Processing (TCP)
- 1.7K Web Experience Management
- 55 Tempo Social
- 1 XM Fax