TIBCOSoftware / jasperreports

JasperReports® - Free Java Reporting Library
https://community.jaspersoft.com/downloads/community-edition/
GNU Lesser General Public License v3.0
1.03k stars 397 forks source link

Text Field printing a string concatenation variable can't "stretchHeight" if variable has reset type #158

Closed gustavofcalmeida closed 3 years ago

gustavofcalmeida commented 3 years ago

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.

As there is no place for attachments here, I reference the bug I reported in the tracker, where there is fully funcional example: https://community.jaspersoft.com/jasperreports-library/issues/13216

shertage commented 3 years ago

As shown in the community tracker this is the expected behavior for textfields with delayed evaluation. In such cases we can use component elements (such as tables or subreports) working with subdatasets.

teodord commented 3 years ago

If you need to display this in the group footer, just leave evaluationTime=Now (which is the default). However, if you need to display it in the group header, then indeed you need evaluationTime=Group, which means the text field would no longer be allowed to stretch, because it would have to push again content below it and ruin everything that has already been rendered. This is expected behaviour, as already mentioned.