Loading jasperreports' .jrxml files

后端 未结 2 1228
挽巷
挽巷 2021-01-25 08:02

In my project I have stored .jrxml files in a package called com/bio/ofm/mnu/views/reports/jasperReports/ When I try to load a .jrxml I get following error,

net.         


        
相关标签:
2条回答
  • 2021-01-25 08:37

    i'm compiling my reports like that:

    ByteArrayInputStream is = MyRenderer.class.getClassLoader().getResourceAsStream("anytemplate.jrxml");
    
    JasperDesign jasperDesign = JRXmlLoader.load(is);
    JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    
    0 讨论(0)
  • 2021-01-25 08:40

    When loading the file as a stream like below it worked,

    InputStream in = this.getClass().getClassLoader().getResourceAsStream("com/bio/ofm/mnu/views/reports/jasperReports/repAuditReport.jrxml");
    
    JasperReport report = JasperCompileManager.compileReport(in);
    
    0 讨论(0)
提交回复
热议问题