0

Jasper Report truncates dynamic text field (vertical column header). I have to show a whole header of group of columns. For example: ToooooLongVerticalName Name2 Name3 Name4.

I need to adjust height of dynamic column to the tallest object. If I increase height from "67" to "107" I get free space if building names are too short. And if I leave height as "67" building name is truncated.

<columnGroup name="BUILDING" height="67" totalPosition="End" headerPosition="Center">
                        <bucket class="java.lang.String">
                            <bucketExpression><![CDATA[$F{BUILDING}]]></bucketExpression>
                        </bucket>
                        <crosstabColumnHeader>
                            <cellContents mode="Transparent">
                                <box>
                                    <topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
                                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    <bottomPen lineWidth="0.0" lineColor="#000000"/>
                                    <rightPen lineWidth="0.25" lineStyle="Solid" lineColor="#000000"/>
                                </box>
                                <textField isStretchWithOverflow="true" isBlankWhenNull="false">
                                    <reportElement key="textField" positionType="Float" stretchType="RelativeToTallestObject" x="0" y="0" width="19" height="67" uuid="8e8cb43c-fdfb-43dc-b92f-e4f874616e70"/>
                                    <box>
                                        <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                        <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                        <bottomPen lineWidth="0.0" lineColor="#000000"/>
                                        <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    </box>
                                    <textElement textAlignment="Left" verticalAlignment="Middle" rotation="Left">
                                        <font fontName="Verdana" size="8"/>
                                    </textElement>
                                    <textFieldExpression><![CDATA[$V{BUILDING}]]></textFieldExpression>
                                </textField>
                            </cellContents>
                        </crosstabColumnHeader>
                        <crosstabTotalColumnHeader>
                            <cellContents mode="Transparent">
                                <box>
                                    <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                    <bottomPen lineWidth="0.0" lineColor="#000000"/>
                                    <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                                </box>
                            </cellContents>
                        </crosstabTotalColumnHeader>
                    </columnGroup>
Will Graham
  • 340
  • 1
  • 3
  • 16
  • stretchWithOverflow? – Petter Friberg Aug 20 '16 at 21:21
  • Possible duplicate of [JasperReport - wrap text to show long text in textfield](http://stackoverflow.com/questions/10631806/jasperreport-wrap-text-to-show-long-text-in-textfield) – Alex K Aug 20 '16 at 22:39
  • That solution doesn't work for me. I set stretchWithOverflow=true, positionType=Float StretchType=Relative to Band Height (or Tallest Object). Column header is dynamic – Will Graham Aug 21 '16 at 07:32
  • Could you post (in the body of [your orginal post](http://stackoverflow.com/posts/39058089/edit)) the small sample to reproduce the problem? – Alex K Aug 21 '16 at 10:26
  • I posted body, please help – Will Graham Aug 21 '16 at 11:06

0 Answers0