admin管理员组文章数量:1316388
column2 and column3 don't stretch as column1 though if column 2 and 3 are higher than column1, column 1 will stretch right to their height
that's the code of my jasper report which i use as subreport
<jasperReport xmlns=";
xmlns:xsi=";
xsi:schemaLocation=" .xsd"
name="subReport" pageWidth="555" pageHeight="802" columnWidth="535" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="12345678-1234-1234-1234-123456789012">
<style name="Default" isDefault="true" mode="Transparent" fontName="Arial" pdfFontName="Arial" pdfEncoding="Identity-H"/>
<subDataset name="dataset1">
<queryString>
<![CDATA[]]>
</queryString>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<field name="state" class="java.lang.String">
<fieldDescription><![CDATA[state]]></fieldDescription>
</field>
</subDataset>
<parameter name="pln" class="java.lang.String" isForPrompting="false"/>
<field name="name" class="java.lang.String">
<fieldDescription><![CDATA[name]]></fieldDescription>
</field>
<field name="orw" class="java.util.List"/>
<columnHeader>
<band height="20" isSplitAllowed="true" splitType="Stretch">
<printWhenExpression><![CDATA[$V{PAGE_NUMBER}==1]]></printWhenExpression>
<textField isStretchWithOverflow="true">
<reportElement x="50" y="0" width="150" height="20" stretchType="RelativeToBandHeight"/>
<box >
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true" isUnderline="false"/>
</textElement>
<textFieldExpression><![CDATA["col1"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement x="200" y="0" width="150" height="20" stretchType="RelativeToBandHeight"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true" isUnderline="false"/>
</textElement>
<textFieldExpression><![CDATA["col2"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement x="350" y="0" width="150" height="20" stretchType="RelativeToBandHeight"/>
<box>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true" isUnderline="false"/>
</textElement>
<textFieldExpression><![CDATA["col3"]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<printWhenExpression><![CDATA[!$F{orw}.isEmpty()]]></printWhenExpression>
<textField isStretchWithOverflow="true">
<reportElement stretchType="ElementGroupHeight" x="50" y="0" width="150" height="20"/>
<box leftPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$F{name}.equals($P{pln}) ? $F{name} : $P{pln} + "\n" + $F{name}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement x="200" y="0" width="300" height="20" stretchType="ElementGroupHeight"/>
<jr:list xmlns:jr="; xsi:schemaLocation=" .xsd" printOrder="Vertical">
<datasetRun subDataset="dataset1">
<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{orw})]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="20" width="300">
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="150" height="20" stretchType="ElementGroupHeight"/>
<box leftPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" />
<textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement x="150" y="0" width="150" height="20" stretchType="ElementGroupHeight"/>
<box leftPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" />
<textFieldExpression><![CDATA[$F{state} == null ? "unkn : $F{state}]]></textFieldExpression>
</textField>
</jr:listContents>
</jr:list>
</componentElement>
</band>
</detail>
</jasperReport>
I've tried different ways to fix it but it seems like text element in bundle ignores list total height and can stretch above it, though if list height is more it gonna stretch.
I would be pleased if anyone could help me with my question
本文标签: elements in band don39t stretch correctly in jasper reportsStack Overflow
版权声明:本文标题:elements in band don't stretch correctly in jasper reports - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742000011a2410819.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论