Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » BIRT » Connection Pool in Birt Viewer
Connection Pool in Birt Viewer [message #991187] Mon, 17 December 2012 11:24 Go to next message
Silver wang is currently offline Silver wang
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] Tue, 18 December 2012 21:37 Go to previous message
Jason Weathersby is currently offline Jason Weathersby
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: Tue Jul 29 09:03:39 EDT 2014

Powered by FUDForum. Page generated in 0.01768 seconds