Jump to content
We've recently updated our Privacy Statement, available here ×

Exporting JasperDesign object


nockdg

Recommended Posts

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

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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...