Hi
I have designed a report for invoices. In the Design-Preview it works fine, but I don't understande, how to start the report from my application?
I took some example and tried following code with a button to start my report. But it dosn't work! :-(
printPDFButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {
IReportEngine engine = null;
EngineConfig config = null;
try{
config = new EngineConfig();
Platform.startup( config );
IReportEngineFactory factory = (IReportEngineFactory) Platform
.createFactoryObject(IReportEngineFactory
.EXTENSION_REPORT_ENGINE_FACTORY );
engine = factory.createReportEngine( config );
IReportRunnable design = null;
//Open the report design
design = engine.openReportDesign("D://temp//invoice.rptdesign");
IRunAndRenderTask task = engine.createRunAndRenderTask(design);
task.setParameterValue("InvoiceID", (new Integer(10)));
task.validateParameters();
IRenderOption options = new PDFRenderOption();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
options.setOutputStream(bos);
options.setOutputFormat("pdf");
options.setOutputFileName("D://temp//invoice.pdf");
task.setRenderOption(options);
task.run();
task.close();
engine.destroy();
}catch( Exception ex){
ex.printStackTrace();
} finally {
Platform.shutdown( );
}
}
@Override
public void widgetDefaultSelected(SelectionEvent e) {
}
});
It generate a PDF, but without any data?! And a long list of ERRORS:
25.03.2009 14:47:31 org.eclipse.birt.data.engine.odaconsumer.Driver doGetDriverManifest
SCHWERWIEGEND: Cannot process data source extension configuration.
java.lang.IllegalArgumentException: org.eclipse.birt.report.data.oda.jdbc
at org.eclipse.datatools.connectivity.oda.util.manifest.ManifestExplorer.getExtensionManifest(ManifestExplorer.java:200)
at org.eclipse.birt.data.engine.odaconsumer.Driver.doGetDriverManifest(Driver.java:147)
at org.eclipse.birt.data.engine.odaconsumer.Driver.findDataSourceExtensionConfig(Driver.java:123)
.....
and so on.....
Anyone has an idear, how I can implement the report into my application?
Thank's for any help!