Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » BIRT » Connection Pool in Birt Viewer
Connection Pool in Birt Viewer [message #991187] Mon, 17 December 2012 16:24 Go to next message
Silver wang is currently offline Silver wangFriend
Messages: 3
Registered: December 2012
Junior Member
All,
I am new to Birt so please pardon my question below, I was able to inject connection before I ran the report, the output shows proper result. see codes below:

IRunAndRenderTask task = engine.createRunAndRenderTask(design);

Map<String, Object> appContext = task.getAppContext();
appContext.put("OdaJDBCDriverPassInConnection", setupJdbcConnection());
appContext.put("OdaJDBCDriverPassInConnectionCloseAfterUse", false);
task.setAppContext(appContext);

HTMLRenderOption options = new HTMLRenderOption();
//Set ouptut location
options.setOutputFileName("D:/reports/new_report_1.html");
//Set output format
options.setOutputFormat("html");
task.setRenderOption(options);

//run the report and destroy the engine
//Note - If the program stays resident do not shutdown the Platform or the Engine
task.run();
task.close();


I am wondering if I can still show this output file(html or pdf...) in Birt report viewer? Please advice how to, Your help is greatly appreciated.

Thanks
Re: Connection Pool in Birt Viewer [message #991420 is a reply to message #991187] Wed, 19 December 2012 02:37 Go to previous message
Jason Weathersby is currently offline Jason WeathersbyFriend
Messages: 9167
Registered: July 2009
Senior Member

If you want to use the viewer, have you tried this approach:
http://wiki.eclipse.org/Adding_an_Object_to_the_Application_Context_for_the_Viewer_%28BIRT%29

BTW you can also get the appcontex in report script in the beforeOpen of the datasource
importPackage(Packages.your.package.to.createjdbcconn);
var conn = new MyJdbcConn();
reportContext.getAppContext().put("OdaJDBCDriverPassInConnection", conn);


Jason
Previous Topic:Create elements that derive from rptlibrary using Designer API
Next Topic:BIRT Report Chart not showing on IE8
Goto Forum:
  


Current Time: Thu Apr 25 20:42:01 GMT 2024

Powered by FUDForum. Page generated in 0.02837 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top