nockdg Posted May 12, 2009 Share Posted May 12, 2009 We have a set of reports that are dynamically generated in Java code and so I have a function that can save the JasperDesign to a jrxml file. Previously this was just:JasperDesign jd = ...try { String classContent = net.sf.jasperreports.engine.design.JRClassGenerator.generateClass(jd); java.io.File f = new java.io.File(aFile); java.io.FileOutputStream fos = new java.io.FileOutputStream(f); fos.write(classContent.getBytes()); fos.close();} catch (Exception e) { e.printStackTrace();} But now with JasperReports 3, this does not exist. The new version requires a JRSourceCompileTask which in turn requires a number of additional objects. So far I haven't found the correct incantation to get this working. Can anyone help or is there an easier way?Thanks. Link to comment Share on other sites More sharing options...
C-Box Posted May 13, 2009 Share Posted May 13, 2009 We do use the JasperCompileManager for that (just to ensure to have a valid design).... JasperCompileManager.writeReportToXmlFile(report, fileName); hthC-Box 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