hiroshi_abe Posted December 22, 2022 Posted December 22, 2022 Trying JasperFillManager.fillReport with right template (relative/absolute)path in JAVA11 environment, exception occured.Do you have the same probled?
hiroshi_abe Posted December 22, 2022 Author 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: }
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