Jasper reports 标题栏自动高度
根据参数,某些文本字段不会显示在我的报告的标题栏标题中 但标题栏的高度是固定的。所以,当文本字段不显示时,标题栏中要么有空白。或者,当我使标注栏高度变小并显示这些字段时,会出现编译错误 那么,如何制作动态标题栏高度Jasper reports 标题栏自动高度,jasper-reports,Jasper Reports,根据参数,某些文本字段不会显示在我的报告的标题栏标题中 但标题栏的高度是固定的。所以,当文本字段不显示时,标题栏中要么有空白。或者,当我使标注栏高度变小并显示这些字段时,会出现编译错误 那么,如何制作动态标题栏高度 <parameter name="param" class="java.lang.Boolean"> <defaultValueExpression><![CDATA[true]]></defa
<parameter name="param" class="java.lang.Boolean">
<defaultValueExpression><![CDATA[true]]></defaultValueExpression>
</parameter>
<title>
<band height="128" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<staticText>
<reportElement x="30" y="90" width="100" height="30" uuid="4e7618ed-21d8-47d2-99fb-7b88a5b7cfce">
<printWhenExpression><![CDATA[$P{param}]]></printWhenExpression>
</reportElement>
<text><![CDATA[Static Text]]></text>
</staticText>
<textField>
<reportElement x="30" y="10" width="100" height="30" uuid="005a53c9-a02d-436f-b35d-526ccf4aace9"/>
<textFieldExpression><![CDATA["Text Field"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="30" y="50" width="100" height="30" uuid="caa2031a-3b71-43a2-bb39-916599872e94"/>
<textFieldExpression><![CDATA["Text Field"]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="43" splitType="Stretch">
<textField>
<reportElement x="30" y="6" width="100" height="30" uuid="30652d38-43f3-4574-a743-bb6240c2cb52"/>
<textFieldExpression><![CDATA["Text Field"]]></textFieldExpression>
</textField>
</band>
</pageHeader>
在本例中,param==false
时有空格。
但是,如果我将标题栏高度设置得更小,则会出现编译错误。必须将文本字段的
isRemoveLineWhenBlank
设置为true
<reportElement x="30" y="90" width="100" height="30" isRemoveLineWhenBlank="true" uuid="4e7618ed-21d8-47d2-99fb-7b88a5b7cfce">
您应该发布小jrxml,以重现我发布的示例中的问题。