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