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

How to know the JasperReports version from binary file


Go to solution Solved by Raphaël Peguet,

Recommended Posts

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Raphaël is correct about an XML comment line indicating the JSS and JRL used to create the file but you must look at that line using a text editor that is not Jasper Studio.  The reason is that Jasper Studio will update that comment as it opens the file skewing the results.

 

I verified this by opening a 6.14.0 file in a 6.20.6 studio and then looked at the source.

Comment in text editor

<!-- Created with Jaspersoft Studio version 6.14.0.final using JasperReports Library version 6.14.0-2ab0d8625be255bf609c78e1181801213e51db8f  -->

After opening on 6.20.6 Studio and looking at the source tab

<!-- Created with Jaspersoft Studio version 6.20.6.final using JasperReports Library version 6.20.6-5c96b6aa8a39ac1dc6b6bea4b81168e16dd39231 -->

 

Link to comment
Share on other sites

  • 3 weeks later...
On 1/27/2024 at 4:09 PM, jgust said:

Raphaël is correct about an XML comment line indicating the JSS and JRL used to create the file but you must look at that line using a text editor that is not Jasper Studio.  The reason is that Jasper Studio will update that comment as it opens the file skewing the results.

 

I verified this by opening a 6.14.0 file in a 6.20.6 studio and then looked at the source.

Comment in text editor

<!-- Created with Jaspersoft Studio version 6.14.0.final using JasperReports Library version 6.14.0-2ab0d8625be255bf609c78e1181801213e51db8f  -->

After opening on 6.20.6 Studio and looking at the source tab

<!-- Created with Jaspersoft Studio version 6.20.6.final using JasperReports Library version 6.20.6-5c96b6aa8a39ac1dc6b6bea4b81168e16dd39231 -->

 

I had missed that but that's right. JSS v. 9 didn't fix that so I brought this up to the team

Link to comment
Share on other sites

When you switch to the source tab, you are looking at what the file would look like if saved, not the content of the actual loaded file. The source shown in the tab is generated on the fly based on the current model in the designer. You can easily check this by adding a comment to your jrxml with a text editor and load the jrxml in the designer, you will see that in the tab source your comment is gone.
The comment show in the source tab will be save only if you save the file.
There is currently no reliable way to check with which version of JRL a jrxml or as jasper file has been created. If you need this information, you can still store it in a report property and read it with JasperReports itself.

Link to comment
Share on other sites

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