hiroshi_abe Posted December 22, 2022 Share Posted December 22, 2022 Trying JasperFillManager.fillReport with right template (relative/absolute)path in JAVA11 environment, exception occured.Do you have the same probled? Link to comment Share on other sites More sharing options...
mahadiosb Posted December 22, 2022 Share Posted December 22, 2022 Do you use any sub report? Link to comment Share on other sites More sharing options...
hiroshi_abe Posted December 22, 2022 Author Share Posted December 22, 2022 Hi mahadiosb,Thank you for comment.I don't use any Subreport in my jrxml.Sorry, I missed compileReport had exception before fillReport.Even though removed all elements from sample.jrxml, compileReport failed.1: public static void main(String[] args) throws Exception {2: 3: Map<String, Object> parameters = new HashMap<>();4: JRCsvDataSource dataSource = new JRCsvDataSource(JasperMain.class.getResourceAsStream("sample.csv"));5: dataSource.setUseFirstRowAsHeader(true);6: try (InputStream template = JasperMain.class.getResourceAsStream("sample.jrxml")) {7: JasperReport report = JasperCompileManager.compileReport(template);8: JasperPrint jasperPrint = JasperFillManager.fillReport(report, parameters, dataSource);9: JasperExportManager.exportReportToPdfFile(jasperPrint, "sample.pdf");10: }catch (Exception e) {11: System.out.print(e.getMessage());12: }13: } Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now