[#13216] - Text Field printing a string concatenation variable can't "stretchHeight" if variable has reset type

Bug report
Project: Severity:
Component: Reproducibility:
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.

Binary Data concatenation.jrxml2.88 KB
File fakecsvdata.xml822 bytes
File data.csv381 bytes
Package icon ignore7.31 KB
Package icon ignore2.06 KB
gustavofarias's picture
Joined: May 22 2012 - 7:10am
Last seen: 1 day 19 hours ago



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:
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).

Binary Data concatenation_modified.jrxml5.05 KB