1

I'm trying to preview a Jasper report in iReport and am getting this error.

Error filling print... Font 'Helvetica' is not available to the JVM. See the Javadoc for more details.

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Helvetica' is not available to the JVM. See the Javadoc for more details.     at net.sf.jasperreports.engine.util.JRFontUtil.checkAwtFont(JRFontUtil.java:358)     at net.sf.jasperreports.engine.fill.TextMeasurer.measureSimpleText(TextMeasurer.java:537)     at net.sf.jasperreports.engine.fill.TextMeasurer.measure(TextMeasurer.java:341)     at net.sf.jasperreports.engine.fill.JRFillTextElement.chopTextElement(JRFillTextElement.java:511)     at net.sf.jasperreports.engine.fill.JRFillStaticText.prepare(JRFillStaticText.java:183)     at net.sf.jasperreports.engine.fill.JRFillElementContainer.prepareElements(JRFillElementContainer.java:328)     at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:393)     at net.sf.jasperreports.engine.fill.JRFillBand.fill(JRFillBand.java:352)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillTitle(JRVerticalFiller.java:323)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:257)     at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:128)     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:836)     at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:746)     at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:58)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:417)     at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:247)     at com.jaspersoft.ireport.designer.compiler.IReportCompiler.run(IReportCompiler.java:879)     at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)     at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:997)

I have found here Jasper stops finding one font instructions to set net.sf.jasperreports.awt.ignore.missing.font=true in the default.jasperreports.properties inside modules/etc/jasperreports-4.5.0.jar.

But this has had no effect. Is that the correct properties file, that iReport uses when compiling a preview?

Community
  • 1
  • 1
Dan Walmsley
  • 2,765
  • 7
  • 26
  • 45

2 Answers2

5

First: the ignore missing font property stopped working in JR 4.5.0. It's a bug. It's already fixed in trunk. You can either get that or wait for 4.5.1.

Second: ignoring the missing font is (obviously) a non-ideal solution compared to actually finding the font that you want. If your report needs Helvetica, then you should use font extensions to include Helvetica on your server. If your report doesn't really need Helvetica, then just change your report to use a logical font like 'Serif' and let the JVM use whatever its default serif font is.

mdahlman
  • 9,204
  • 4
  • 44
  • 72
  • Thanks, Yeah this is far from an Ideal solution. But unfortunately sourcing (licencing) the correct font or changing the report font are not options. – Dan Walmsley Feb 22 '12 at 22:13
  • this is usually caused by template ireport and then installing netbeans plugin for example then it will compile but not run as change to serif solved it:) +1 – shareef Feb 04 '13 at 09:39
  • The second pois is what I'm doing. I'm using font extensions, and added the jar to the classpath, but it doesn't work. Besides that, it's necessary to install the font in the OS. I don't know why. I think it shouldn't be like this. – Gustavo Dec 04 '15 at 14:51
1

Try import a new font over tools>options>fonts inserting fontxyz.ttf an remember, export how a extension and add the jar to your project or, change all fields to on native font that showed on a panel tools>options>fonts.

Alexis Pigeon
  • 7,423
  • 11
  • 39
  • 44
lucasddaniel
  • 1,779
  • 22
  • 22