Jump to content

Recommended Posts

Posted

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?

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted
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));

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...