Category: | Bug report |
Priority: | High |
Status: | New |
Project: | Severity: | Major |
Resolution: | Open |
|
Component: | Reproducibility: | Always |
Assigned to: |
Very easy to reproduce. Attachment has a fully functional example.
It happens when you have a variable that concatenates Strings from a group.
When you put this variable to show in a text field in the group header or footer, the text field is unable to stretch it's height as any text field should.
I noticed that this happens when the variable is set to reset on group change. If I set the reset type to "none", it stretches normally.
I'm sure the variable is holding the full content of the concatenation. You can check this by increasing the height of the text field.
v6.14.0
3 Comments:
This behavior occurs because the textfield itself has a delayed evaluation (evaluationTime="Group" evaluationGroup="Section") in order to print the complete variable value. In case of a delayed evaluation, textfields stretching is inhibited as explained in the xsd schema ( http://jasperreports.sourceforge.net/schema.reference.html#textField_tex... ).
In this case, instead of a textfield you could use an element that performs calculations on a subdataset, like a subreport or a table component.
How can I use the records inside a group as subdataset for a subreport or table? All my data come from a single query, and it would be very costly to submit a new query for each group.
Depending on the report datasource, there are different possibilities to reuse it among several report components. Some useful examples can be found here:
https://community.jaspersoft.com/wiki/reusing-subdataset-data-report
Another way is to refactor the report query in order to retrieve only the needed fields and use parameterized queries in subdatasets.
For the sample attached here, we could simply read the data from the same csv source and use filter expressions in subdatasets (see the modified jrxml example in the attachment).