Issue
-
Liferay Commerce upgraded its internal reporting engine to JasperReports 7, utilizing a new XML schema with a Jackson-based parser that renders older Jasper 6 JRXML files incompatible.
-
How can I upgrade custom Commerce order templates to the JasperReports 7 standard to make my templates compatible, ensure long-term stability, and align with modern data protection standards?
Environment
- Liferay Commerce
Resolution
Follow these steps to prepare your environment, migrate your templates, and upload them to Liferay Commerce:
-
Prepare the Environment: Install and configure Jaspersoft Studio 7.x to use the correct compatibility version.
-
Install Jaspersoft Studio 7.x.
-
Navigate to:
-
Windows/Linux: Window > Preferences; or
-
macOS: Jaspersoft Studio > Settings.
-
-
Navigate to Jaspersoft Studio > Compatibility.
-
Set the Version field explicitly to
7.0.0to prevent the editor from saving files in the incompatible, legacy v6 format.
-
-
Migrate Files from v6 to v7: Migrate the template files using the built-in utility, which handles schema conversions automatically.
-
In the Project Explorer, right-click the folder or specific file you wish to update.
-
Select JasperReports > Update JasperReports files.
-
Verify the target version is
7.0.0and click Finish.
-
.jrxml file, make a minor edit, and click Save to rewrite the XML source automatically.-
Verify Migration: Verify the migration successfully updated the XML namespace and elements.
-
Open the
.jrxmlfile in a text editor. -
Verify the legacy SourceForge URL (namespace header) is removed from the
<jasperReport>tag (e.g.,xmlns="http://jasperreports.sourceforge.net/jasperreports"should be removed). -
Verify the template uses unified
<element>tags (e.g.,<element kind="text"...>or<element kind="textField"...>) instead of specific tags like<staticText>.
-
-
Upload Files: Upload the updated template to Liferay Commerce.
-
As an administrator, open the Global Menu and navigate to Commerce > Channels.
-
Click the specific Channel you wish to update.
-
On the General tab, scroll to the Orders section and locate the Print Order Template field.
-
Click Select File and choose the updated
.jrxmlfile. -
Click Save. The reporting engine automatically compiles and executes the updated source when an order report generates.
-
Additional Information
- This upgrade is required for any bundles leveraging a Liferay version that includes the fix for the private ticket LPD-82858, if a custom print order template is in use.
- If the default print order template is in use, the default template will automatically be updated when patching to the Liferay version containing the upgraded reporting engine.