Novaa Posted January 25, 2017 Posted January 25, 2017 Hello Community,i need to export an jrxml to jpg.This is my code:JasperReport report = (JasperReport) JRLoader.loadObjectFromFile("Barcode.jasper"); HashMap parameter = new HashMap(); JasperPrint print = JasperFillManager.fillReport(report, parameter); JRGraphics2DExporter exporter = new JRGraphics2DExporter(); exporter.setExporterInput(new SimpleExporterInput(print)); exporter.setExporterOutput(new SimpleGraphics2DExporterOutput()); SimpleGraphics2DReportConfiguration param = new SimpleGraphics2DReportConfiguration(); SimpleGraphics2DExporterOutput param2 = new SimpleGraphics2DExporterOutput();[/code]What i need to do next?
hozawa Posted January 25, 2017 Posted January 25, 2017 JasperPrint jasperPrint = (JasperPrint) JasperFillManager.fillReport(jasperReport, null, new JREmptyDataSource()); Image img = JasperPrintManager.printPageToImage(jasperPrint, 0, 2.0f); BufferedImage bi = (BufferedImage)img; ImageIO.write(bi, "jpg", new File(outputFilename));
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