http://dynamicjasper.sourceforge.net/It's dynamic!
DynamicJasper (DJ) is an open source free library that hides the complexity of Jasper Reports, it helps developers to save time when designing simple/medium complexity reports generating the layout of the report elements automatically.
DJ creates reports dynamically, defining at runtime the columns, column width (auto width), groups, variables, fonts, charts, crosstabs, sub reports (that can also be dynamic), page size and everything else that you can define at design time (see features).
DJ keeps full compatibility with Jasper Reports since it's a tool that helps creating reports in a programmatic friendly way, taking care of the report design for you.
Classic .jrxml files can be used as templates while the content and layout of the report elements are handled by the DJ API.
Code: Select all
FastReportBuilder drb = new FastReportBuilder();
DynamicReport dr = drb.addColumn("State", "state", String.class.getName(),30)
.addColumn("Branch", "branch", String.class.getName(),30)
.addColumn("Product Line", "productLine", String.class.getName(),50)
.addColumn("Item", "item", String.class.getName(),50)
.addColumn("Item Code", "id", Long.class.getName(),30,true)
.addColumn("Quantity", "quantity", Long.class.getName(),60,true)
.addColumn("Amount", "amount", Float.class.getName(),70,true)
.addGroups(2)
.setTitle("November 2006 sales report")
.setSubtitle("This report was generated at " + new Date())
.setPrintBackgroundOnOddRows(true)
.setUseFullPageWidth(true)
.build();
JRDataSource ds = new JRBeanCollectionDataSource(TestRepositoryProducts.getDummyCollection());
JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), ds);
JasperViewer.viewReport(jp); //finally display the report report
Πόσο θα κρατήσει το πάρτι?