Reputation: 8620
I'd like to start using iReport (netbeans edition) and replace the good old classic iReport 3.0.x. Seems like the classic iReport won't be improved anymore and abandoned at some point.
The point is that I need to start iReport from another java application. With iReport 3.0 it was pretty easy and straightforward: just invoke it.businesslogic.ireport.gui.MainFrame.main(args);
and iReport is up and running.
The problem is I have no clue how to do the same thing in iReport-nb. The netbeans platform is a completely unkown for me and I could not find anything that looks like a main method or application starting point. It seems to load a lot of net beans platform stuff first and somehow hides the iReport starting point.
Upvotes: 0
Views: 5873
Reputation: 9533
1)Designing:For designing the report the idea is pretty much the same. After installing plugin make new->report and start designing.When you finish choose preview and the iReport will compile your report resulting a .jasper file.
2)Execute:Write the code to pass the data and run the .jasper from your java code Something like that:
JasperPrint print=null;
ResultSet rs=null;
try {
Statement stmt = (Statement) myConnection.createStatement (ResultSet.TYPE_SCROLL_SENSITIVE,//Default either way
ResultSet.CONCUR_READ_ONLY);
rs = stmt.executeQuery("select * from Table");
} catch (SQLException sQLException) {
}
try {
print = JasperFillManager.fillReport(filename, new HashMap(), new JRResultSetDataSource(rs));
} catch (JRException ex) {
}
try{
JRExporter exporter=new net.sf.jasperreports.engine.export.JRPdfExporter();
exporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, pdfOutFileName);
exporter.setParameter(JRExporterParameter.JASPER_PRINT, print);
exporter.exportReport();
}..........
Upvotes: 0
Reputation:
iReport based on the NetBeans platform works as standalone application (just like the classic one), even if it can be installed and used as NetBeans plugin too. Soon iR 3.5.2 will be released, it will cover all the remanining features present in iR classic that have been not covered yet in the previous versions, but on the other hand it provides plenty of new features and support for JasperReports 3.5.2 including a full new implementation of Barcode component, List (which are kind of light subreports), new chart types, support for multi-bands for detail and group header/footer, integrated preview and so on.
Here you can find some tips about how to start a NetBeans platform based applications from another java application. Not trivial, since you need to set up a little bit the environment, but definitively doable: http://wiki.netbeans.org/DevFaqPlatformAppAuthStrategies
Giulio
Upvotes: 1
Reputation: 326
Why do you think it's abandoned? The latest version is 3.5.0 now btw. And what reasons are to change it to netbeans edition? Imho the main application is still iReport, and the NetBean plugin whis functionality is same with "plain old iReport".
And back to your question. iReport is stand-alone application, while "NetBeans edition" is just plugin, so you must start NetBeans IDE and then switch its layout to iReport plugin.
Upvotes: 0