In a report I have several text fields that I wish to output one above the other, but sometimes they are not populated and in this case I do not wish to have blank space in the report.
To solve this, I have set the fields to be 1px in height and arranged them one above the other, spaced at 2px intervals. They are set to "StretchHeight" where appropriate.
This works very well, both within Jasper Studio and when exporting the report as a PDF.
However, when one of the fields has more than one line and also has the "Spacing Before" property set to a value above 0, the second line of text is not visible when the report is exported as a PDF. It is visible within Jasper Studio (in the report preview).
The problem can be "resolved" by setting the "Spacing Before" property on the text field that is being truncated to 0px (although that doesn't resolve the issue for me because all my text is then squashed together, vertically, with no space in between - I need to use the "Spacing Before" property).
That the problem occurs during a PDF export and not within the Jasper Studio preview suggests the "Spacing Before" property is not being sent correctly to the AWT library during the export.
Hi can you please attach a sample report? It would help.
That said I think this is more a JasperReports Library related problem.
The problem is still present in version 6.18.1. I have attached an example report. The third line is missing in the pdf. Possibly this is also related to the following error: https://community.jaspersoft.com/jasperreports-library/issues/13886