Jump to content

tempusfugit

Members
  • Posts

    1
  • Joined

  • Last visited

 Content Type 

Forum

Downloads

Featured Visualizations

Knowledge Base

Documentation (PDF Downloads)

Blog

Documentation (Test Area)

Documentation

Dr. Jaspersoft Webinar Series

Security Advisories

Events

Profiles

Posts posted by tempusfugit

  1. Hello everyone,

     

    i'm about to write an application using  JasperReports 3.5.3. The reports contain subreports, pictures and different fonts. I want to get some pdf documents, so i use the pdfFontName attribute to set the font. The grapichs and subreports have absolute paths using parameters.

    eg

    String subReportDir = "C:/my reports/subreports";
    params.put ("SUBREPORT_DIR", subreportDir);
    


     

    So far no problem.

    But I want the font paths also pass through from the application. But I wasn't able to use a parameter in the attribute pdfFontName.

    I tried to avoid this problem by using  the REPORT_FILE_RESOLVER parameter:

    String fontDir = "C:/fonts";
    params.put(JRParameter.REPORT_FILE_RESOLVER, new SimpleFileResolver(new File(fontDir)));
    

     

    When I use the REPORT_FILE_RESOLVER parameter I get the exception:

    net.sf.jasperreports.engine.JRException: Could not load object from location : C:\my reports\subreports\anySubReport.jasper

            at net.sf.jasperreports.engine.util.JRLoader.loadObjectFromLocation(JRLoader.java:273)
            at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluateSubreport(JRFillSubreport.java:321)
            at net.sf.jasperreports.engine.fill.JRFillSubreport.evaluate(JRFillSubreport.java:270)
            at net.sf.jasperreports.engine.fill.JRFillElementContainer.evaluate(JRFillElementContainer.java:260)
            at net.sf.jasperreports.engine.fill.JRFillBand.evaluate(JRFillBand.java:486)
            at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillColumnBand(JRVerticalFiller.java:1427)
            at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillDetail(JRVerticalFiller.java:729)
            at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReportStart(JRVerticalFiller.java:256)
            at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:114)
            at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:911)
            at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:123)
            at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:439)
            at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:402)

     

    Without using the REPORT_FILE_RESOLVER I don't get this exception. The subreport is at this location. I don't know, what should be wrong, so is this a bug?

    Anyone got an idea, how to pass the path for the fonts to JasperReports?

     

    Thanks,

    Daniel

    Code:
    
    						
×
×
  • Create New...