Accessing the ReportEngine within a RCP configuration [message #1744645] |
Thu, 29 September 2016 08:52 |
Mario CC Messages: 6 Registered: April 2016 |
Junior Member |
|
|
Hi,
I just started using Birt and I have a fundamental question:
How can I access a ReportEngine reference within a RCP config?
I integrated birt in an RCP application using the WebViewer.display method:
public class ReportingView extends ViewPart {
public void createPartControl(Composite parent) {
Browser browser = new Browser(parent, SWT.NONE);
HashMap<String, Serializable> myparms = new HashMap<String, Serializable>();
// Birt Viewer parameters
myparms.put("SERVLET_NAME_KEY", "frameset");
myparms.put("FORMAT_KEY", "html");
myparms.put("ALLOW_PAGE", "false");
myparms.put("SHOW_PARAMETER_PAGE", "true");
String path = "";
Bundle bundle = Platform.getBundle("com.example.workbench.reportingview");
URL url = FileLocator.find(bundle, new Path("report.rptdesign"), null);
try {
path = FileLocator.toFileURL(url).getPath();
} catch (IOException e) {
e.printStackTrace();
}
WebViewer.display(path, browser, myparms);
}
}
With some extra configurations, I managed to create a view in my RCP environment that launches a report viewer in order to visualize my report. The Birt engine and the viewer are integrated as plugins.
From this same class, I'm trying to re-execute the report programatically passing a parameter depending on the users interaction with the launched RCP workbench.
How can I access the reference to the actual Report Engine? The report has been executed once, and there is already an engine running...therefore, I supose that it is not necessary to create a new instance of EngineConfig. I just want to access my actual engine (deployed as a plugin) or report and re-execute the report passing some new parameters: as if I was clicking on the "execute raport" icon once the report has already executed once.
I followed the integration tutorial:
http://www.eclipse.org/birt/documentation/integrating/reapi.php
I also tried in order to access the running engine but it did not work. Actually I'm pretty sure that there is no need to create a new instance of the EngineConf but I could not find an alternative way.
EngineConfig config = new EngineConfig( );
config.setEngineHome("");
I'm using Birt 4.5 in Eclipse Mars.
Thank you in advance,
Mario
[Updated on: Thu, 29 September 2016 11:51] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04367 seconds