Tuesday, October 20, 2009

Multiple Hyperlinks on BIRT Charts

BIRT 2.5.1 was released a couple of weeks ago and with its release BIRT Charts now support multiple hyperlinks. To use this feature select any of the interactivity locations within the chart builder. Next select the add button under the hyperlinks list box.

This will launch the hyperlink editor.

Enter the name you wish to appear in the context menu. Next select the edit base URL button, which will display the Hyperlink Options editor.

Here you have the option to link to a URI, a bookmark within the same report or to a bookmark in another report. Values from the current chart can be passed through to the target. For example the value of a slice could be passed to a google query. To do this select the URI radial and enter an expression similar to the one shown in the image below.

When running the report containing the chart, the multiple hyperlinks menu will popup on whatever event you defined in the editor. In the above example this was defined on a mouse click event. So clicking on a slice of the pie will cause the multiple hyperlinks context menu to appear.

This sample report is available at Birt-Exchange.


Nimish said...

This error comes when i try to call this report from my java application
SEVERE: Cannot open connection.
org.eclipse.birt.report.data.oda.jdbc.JDBCException: There is an error in get connection, [ActuateDD][SQLServer JDBC Driver][SQLServer]Login failed for user 'sa'..
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.doConnect(JDBCDriverManager.java:222)
at org.eclipse.birt.report.data.oda.jdbc.JDBCDriverManager.getConnection(JDBCDriverManager.java:179)
at org.eclipse.birt.report.data.oda.jdbc.Connection.connectByUrl(Connection.java:220)
at org.eclipse.birt.report.data.oda.jdbc.Connection.open(Connection.java:151)
can anyone help?i am able to login wiht sa in sqlserver and even the report is running from birt.

Nimish said...

This is my java code:

EngineConfig config = new EngineConfig();
config.getAppContext().put("OdaJDBCDriverClassPath", "E:/birtruntime/birt-runtime-2_3_2/birtruntime/ReportEngine/plugins/org.eclipse.birt.report.data.oda.jdbc_2.3.2.v20090331-1440/drivers/mysql/mysql-connector-java-5.0.4-bin.jar");
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform.createFactoryObject( IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY );
IReportEngine engine = factory.createReportEngine( config );
IReportRunnable design = engine.openReportDesign("E:/Actuate/EqipmentAvailability/EqipmentAvailabilityDashBoard.rptdesign");
IRunTask task = engine.createRunTask(design);
//Set parent classloader for engine
//task.getAppContext().put(EngineConstants.APPCONTEXT_CLASSLOADER_KEY, RunTaskExample.class.getClassLoader());

//run the report and destroy the engine

task.run("E:/Actuate/GroupingTesting/Group.rptdocument"); //at this line is the error