Jump to content

Check iReport / JasperReport compatibility


marco159

Recommended Posts

Hi,
I'd like to know if there's a way (java code) to check compatibility of a .jrxml or .jasper report created with iReport and the JasperReport engine.
Since the iReport and JasperReport versions change frequently, I can't upgrade my installations everytime.
Users download the latest iReport version, upload the report to my application (running a previous version of jasperreport) and then some unexpected errors occur.
Is there a way to get the iReport version used to create a jrxml or jasper file?
I found this way to read the JasperReport version:

net.sf.jasperreports.engine.JasperCompileManager.getClass().getPackage().getImplementationVersion();

but I can't get the iReport version used for a jrxml or jasper file.
By simply comparing the two values I could warn the user that the iReport version used is not right.

Thanks,
Marco
 

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Marco -

I'm just a newbie, but I looked in my .jrxml file produced by iReport and didn't see any XML elements identifying the iReport version, or even that it had been produced by iReport at all.

I think it's reasonable for Jasper Reports not to care whether or not its configuration file was produced by any particular tool, but I agree that it would be helpful for it to know and check.  This could be cumbersome to implement though, and of course it would not know about any versions created after itself.

Maybe even more useful would be to check the content of the XML itself to see if there were any (perceived) errors; then it would catch errors regardless of the way in which the file was created.  Could this be done merely by attempting to load the .jrxml file, or there errors that that does not catch?

- Keith

 

Link to comment
Share on other sites

  • 1 month later...

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