I am creating a java application using DynamicReports and JasperReports.
While trying to show the JasperReportBuilder, I get this error:
...
DEBUG DefaultExtensionsRegistry - Instantiating extensions registry for system.f
ont.families using factory class net.sf.dynamicreports.jasper.base.JasperSystemF
ontExtensionsRegistryFactory
Exception in thread "AWT-EventQueue-0" Exception in thread "AWT-EventQueue-0"
Exception: net.sf.jasperreports.engine.JRRuntimeException thrown from the UncaughtExceptionHandler in thread "AWT-EventQueue-0"
I am truly at a lack of ideas here. I am using JDBC-ODBC bridge to get an Access database (the query works). My piece of code (basically creating the report and the columns dynamically) :
JasperReportBuilder report = report();
try{
report.setTemplate(Templates.reportTemplate);
StyleBuilder titleStyle = stl.style(boldCenteredStyle)
.setVerticalAlignment(VerticalAlignment.MIDDLE)
.setFontSize(15);
report.title(cmp.horizontalList().add(cmp.image("resources/icon.jpg").setFixedDimension(80, 80)
, cmp.text("Gestion de rapports").setStyle(titleStyle)
, cmp.text(rapportSelect.getNomListe()).setStyle(titleStyle).setHorizontalAlignment(HorizontalAlignment.RIGHT))
.newRow().add(cmp.filler().setStyle(stl.style().setTopBorder(stl.pen2Point())).setFixedHeight(10)));
Iterator it = rapportSelect.getMappingColonnes().entrySet().iterator();
while (it.hasNext()) {
Map.Entry pair = (Map.Entry)it.next();
report.columns(col.column((String)pair.getKey(), (String)pair.getValue(), type.stringType()));
}
report.pageFooter(Templates.footerComponent);
String sqlQuery = rapportSelect.getSqlQuery() + " ";
Statement stmt = GestionDbAdapter.getInstance().get().createStatement();
ResultSet rs = stmt.executeQuery(sqlQuery);
report.setDataSource(rs);
report.show(false);
The whole application is very big, so I only put a piece of my code (which I slightely cleaned for stackoverflow). Please advise me if you want more code.