如何在Jasper Report中包装动态垂直文本字段?

时间:2016-08-20 19:47:10

标签: jasper-reports

Jasper Report会截断动态文本字段(垂直列标题)。我必须显示一组列的整个标题。例如: ToooooLongVerticalName Name2 Name3 Name4。

我需要将动态列的高度调整为最高的对象。如果我从" 67"增加高度至" 107"如果建筑物名称太短,我可以获得自由空间。如果我把高度留下来" 67"建筑物名称被截断。

<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>

0 个答案:

没有答案