问题
I would like to resize subreport's text field (before include into main report) like the highest main report's text field.
As you can see the subreport's text field does not have equal height.
回答1:
You need to work with stretchType
, you can't set the height dynamically in any other way (not considering via java code)
On reportElement tag you have the attribute stretchType
, which you can set to RelativeToBandHeight
or RelativeToTallestObject
. I would go for:
stretchType="RelativeToTallestObject"
However this function will stretch relative to largest object in band, which in your case is the band in the subreport, so probably you should think this the other way around, hence
Set desired field size in subreport then stretch the textElements
in your main report, to match the height of your subreport.
来源:https://stackoverflow.com/questions/38767084/how-to-increase-subreports-textfield-height-as-the-height-of-master-reports-te