JasperReports is pretty straightforward when working with sub-reports. But you may need to display multiple different tables within a single report but without knowing how many tables will be needed in the final report. In this case, you need to have a dynamic mechanism. In the following example, a report with a random amount of tables will be created. Continue reading Variable amount of sub-reports in jasper
Tag: jasper
Fat jar with embedded fonts
Creating fat jars using maven is pretty simple. But it won’t simply work if you’re using jasper reports and embed fonts into your PDF reports. You’ll probably end up with an exception like the following:
1 2 3 4 5 6 7 8 9 10 |
Exception in thread "main" java.lang.ExceptionInInitializerError at net.sf.jasperreports.engine.fill.JRBaseFiller.(JRBaseFiller.java:104) at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:72) at net.sf.jasperreports.engine.fill.JRVerticalFiller.(JRVerticalFiller.java:60) at net.sf.jasperreports.engine.fill.JRFiller.createBandReportFiller(JRFiller.java:201) at net.sf.jasperreports.engine.fill.JRFiller.createReportFiller(JRFiller.java:216) at net.sf.jasperreports.engine.fill.JRFiller.fill(JRFiller.java:116) at net.sf.jasperreports.engine.JasperFillManager.fill(JasperFillManager.java:667) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:983) at EmbeddedFontsExample.main(EmbeddedFontsExample.java:18) |
Embedding fonts in jasper reports
As it’s not guaranteed that all users have the same set of fonts, it’s a good idea to embed these fonts into the created PDF-Files, especially if it’s a more or less exotic font. The following example will quickly show the few steps required to accomplish this task. Continue reading Embedding fonts in jasper reports