Home
Developing Analytics Applications
Deploying BIRT in a JAR application
system_migrated
Hello, <br />
I am using BIRT to generate a PDF report from my desktop application. The report is finished, now I just need to deploy it. I dont need any fancy thingies like RCP or viewer, just the button "Generate report", which will save the report in PDF to the given location.<br />
<br />
Now in the handler of the button I have this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
EngineConfig config = new EngineConfig();
config.setEngineHome(EngineHomePath));
try{
Platform.startup(config);
}
catch(BirtException e1){
e1.printStackTrace();
}
IReportEngineFactory factory =
(IReportEngineFactory) Platform.createFactoryObject(IReportEngineFactory.EXTENSION_REPORT_ENGINE_FACTORY);
IReportEngine engine = factory.createReportEngine(config);
IReportRunnable design = null;
try{
design = engine.openReportDesign(getClass().getResourceAsStream("/logic/Report.rptdesign"));
}
catch(EngineException e){e.printStackTrace();}
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
PDFRenderOption options = new PDFRenderOption();
options.setOutputFileName("C:UsersJakubDesktopreport.pdf");
options.setOutputFormat("pdf");
task.setRenderOption(options);
try{
task.run();
}
catch(EngineException e){
e.printStackTrace();
}
task.close();
</pre>
<br />
So I want to know:<br />
What are the absolute minimum required libraries to get these to work (assuming the report has charts)? I am working in Eclipse, so I downloaded the plugin, but I also had to download 124MB runtime to get this to work.<br />
Also the command <pre class='_prettyXprint _lang-auto _linenums:0'>config.setEngineHome(EngineHomePath);</pre> is beyond me - I need everything bundled in one JAR and not specify the path to some external libraries.<br />
<br />
1) What necessary libraries do I need to add to the classpath in order for this to work? <br />
2) I dont want my program to grow 124MB (about 10 000% in this case) just to generate one PDF.<br />
3) What to write to setEngineHome() so that it takes the necessary files from within the bundled Jar?<br />
<br />
Thank you, I am hopelessly lost in all the tutorials and forum questions, you are my only hope.
Find more posts tagged with
Comments
There are no comments yet