Has anyone ever gotten this error in iReport 5.6 when trying to open the jrxml file?
Attribute 'hTextAlign' is not allowed to appear in element 'style'
jrxml. In Jaspersoft Studio, navigate to My Reports > reports. Find and double-click the agent_activity. jrxml file to open it.
What is a JRXML file? A JRXML file is created by JasperReports and contains design definition in popular XML file format. It stores all the design elements such as report layout, text fields, images, charts, parameters, and variables.
jrxml report and rightclick on it. In context menu choose 'Compile report'. Then you get compiled . jasper report.
The jrxml file is just a xml file. It is a common practice to validate xml files with help of XSD schema.
The JasperReports engine is doing the same - it is using xsd schema to validate the report's template (jrxml file).
The xsd was changed at 6.x version compared with 5.x version.
The schema for latest version of JasperReports is available with url. You can always find the link to schema at header of jrxml file:
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport ... xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" ...>
Looks like your template (jrxml file) was created or edited with JasperReports Studio of 6.x version and saved without applying compatitbility with 5.x version option (Compatibility warning dialog).
You can use Jaspersoft Studio (JSS) for modifying report's template. Maybe it is the best choice because the iReport is deprecated (it is not supported since the end of 2015 year) and supports only 5.6 and oldest versions of JasperReports templates/features.
You can save the template at compatitbility mode as 5.x version at JSS and after this continue edit the jrxml file with iReport
The dialog appears during saving template at JSS and looks like this:
To enable this dialog you should change settings at form called via Window -> Preferences menu.
The xsd schema for any version of JasperReports can be found at JasperReports package with source code or at repository of source code.
This is a fragment (screenshot) of comparing xsd files of 5.6.1 (left panel) and 6.3.0 (right panel) versions.
As you can see that the hTextAlign
attribute from your error message presents only at xsd of 6.x version. This is a cause of the error you got
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With