TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.07k stars 404 forks source link

JasperReports Library v7 - Support JRXML conversion #468

Closed danielpeintner closed 1 month ago

danielpeintner commented 3 months ago

The v7 Change Log mentions the following

breaking backward compatibility of source .jrxml report template files and .jrtx style template files by replacing the Apache Commons Digester based parsers with Jackson XML object serialization. .jrxml and .jrtx files created with version 6 or older can no longer be loaded with version 7 or newer of the library alone. The conversion from the old file formats to the new file formats and back can be made using Jaspersoft Studio 7 and later versions of it;

This means that users still having old *.jrxml report template files needs to start Jaspersoft Studio 7 to convert the file accordingly. One the other hand, there is code that allows converting one version to the other (which is great 👍).

Anyhow, I was wondering whether this functionality could be made available with the library itself, meaning that either automatically convert old JRXML or offer a function call that can convert the file if needed.

Use-case: An application might offer to users providing JRXML files on the fly. The use-case is that users still have v6 JRXML files that could be selected for a printout. With the new version 7 compiling fails. Having a way to detect, we could convert if we get provided an old v6 JRXML file.

I think this would be a great addition.

teodord commented 3 months ago

A similar question has been asked on our forums here: https://community.jaspersoft.com/forums/topic/68669-is-there-a-way-to-programmatically-convert-jasperreports-6x-jrxml-templates-to-version-7x/

Reiterating here the possible ways to address this going forward:

1) Users having JRXML 6 reports can use JSS CE 7 on their own to convert the files to JRXML 7 before providing them to the application that allows running them;

2) The application running the reports would not need to convert the JRXML files provided that it uses the JasperReports Library Professional/commercial version. This version is not released yet but is planned to be released soon. This distribution of our software will have the ability to work with older file formats.

3) Continue using version 6 of JasperReport library and Studio.

I hope this helps. Teodor

meshpaul commented 3 months ago

This conflicts with the open-source ethos of transparency and collaboration. The library it is tied to JasperReportsStudio and it shouldn't be as this violates the spirit of Open Source. There should be a utility to convert old JRXML files as part of this library.

FYI I just ran into an issue where JSS CE7 didn't convert physical JRXML file but I could see the changes in the source tab.

teodord commented 1 month ago

JSS CE 7.0.1 release is available here: https://community.jaspersoft.com/download-jaspersoft/community-edition/jaspersoft-studio_7.0.1 I bring it up just because it might solve the issue with the conversion of physical files mentioned above.

Thank you, Teodor

danielpeintner commented 1 month ago

Can you describe what has changed or how it is meant to work. The link you shared doesn't give any insight.

I tried to load an old jrxml file with version 7.0.1 but I still get net.sf.jasperreports.engine.JRException: Unable to load report

So I assume it does not automatically convert old jrxml files to the new version.

teodord commented 1 month ago

Where are you getting this exception? In Jaspersoft Studion CE 7.0.1? Or in the application where you deploy the JRXML?

Thank you, Teodor

danielpeintner commented 1 month ago

Where are you getting this exception? In Jaspersoft Studion CE 7.0.1? Or in the application where you deploy the JRXML?

My use-case is (as mentioned above, see https://github.com/TIBCOSoftware/jasperreports/issues/468#issue-2453484198) is that users still have old jrxml files on their disks etc.

If I update in my application to version implementation 'net.sf.jasperreports:jasperreports:7.0.1' such users can no longer load their jrxml files. They would need to open the JRXML in the JasperSoft Studio and "convert" it manually.

Hence, I was asking whether there is a way that either

I hope this makes clear what I (and I think many others) would need since there are many applications out there that used the old format...

Hence, the error Unable to load report comes from an application that updated its dependency to 7.0.x

teodord commented 1 month ago

I only announced here the availability of JSS CE 7.0.1, which is the tool to manually convert JRXML files mentioned in my numbered list above at point 1. I thought you tried it and it did not work for you.

Sorry for the misunderstanding. I have nothing to add to my initial reply on this thread.

Thank you, Teodor