Category: | Bug report |
Priority: | Normal |
Status: | Resolved |
Project: | Severity: | Minor |
Resolution: | Fixed |
|
Component: | Reproducibility: | Always |
Assigned to: |
Several styles are defined via IReport Styles menu. One style is Parent Style for other styles. The order of creation is sub styles first then parent style (happened because of style hierachy was changed later by user).
Error: When a .jrxml file is generated, the styles are defined in order of creation, not hierarchy. On report generation this leads to the error message "ParentStyleName" not found.
Child style references Parent Style before it is instantiated/found in jrxml file.
Workaround for the user:
Delete all styles and create in order of hierarchy again.
Or:
Move the <style> block of ParentStyle to the begin of all style blocks manually in the .jrxml file with an editor and save file. Reload file in IReport.
2 Comments:
I have a similar behavior - 9 years later.
We use JasperReports 6.2 and JasperStudio 6.2 on Windows 7.
I have a style template file (.jrtx) with some styles, the default style is named "Root". All other styles in the .jrtx files are children with "Root" style as parent style. We import the .jrtx file in a lot or report-designs (*.jrxml) . This works well.
Now if add a local style (i.e. named "LocalStyle") the report-design (*.jrxml) and use it there. This works also.
But if I want to set the "Root" style as parent style for "LocalStyle", then I get the error "Style Root not found".
So I cannot use a style of a template file as parent style in a report-design in JasperReports 6.2. In my opinion this is a bug.
Thx, @abourgett, your solution works still well on Jasper Studio.