We use the Birt report viewer deployed to Tomcat. Then, from our applications, we "launch" a new browser window with a URL to show a particular (user-selected) report.
As far as launching a new window goes, here's the external type def and JavaScript for the external type:
com.mypackage.customer.widgets.Launch.egl
externalType Launch extends Widget type JavaScriptObject {
relativePath = "com/mypackage/custom/widgets",
javaScriptName = "Launch"
}
function openWindow(host string in, reportPath string in) returns(boolean);
end
WebContent/com/mypackage/customer/widgets/Launch.js
egl.defineClass(
'com.mypackage.custom.widgets', 'Launch',
{
"constructor" : function()
{ },
"openWindow" : function (host, reportPath) {
var d = new Date();
var t_min = d.getMinutes(); // Returns minutes
var t_sec = d.getSeconds(); // Returns seconds
var t_mil = d.getMilliseconds(); // Returns Milliseconds
var winName='appWindow'+t_min+t_sec+t_mil;
var windowUrl=host+escape(reportPath);
m = window.open(windowUrl,winName,'resizable=yes');
return true;
}
});
Then, from a Rich UI handler or widget:
launch Launch {};
launch.openWindow(host, reportPath);
Our "host" variable is something like "http://www.xxxxxxxxxxxxxx.com:8081/birt/frameset?__report=/" (using the protocol, server, and port where we host the Birt report viewer). And, for us, a "reportPath" variable looks something like "AlInvoices.rptdesign".
Note: The Birt viewer requires configuration to be able to find the report designs that are pre-deployed to the server. This is described in the Birt documentation.
Hope this helps.
--Dan
p.s. We use a nearly identical technique to serve up PDF's and other document types by substituting a different "host" and "reportPath"....a host and report path not related to Birt.
dan_darnell