导出JasperReport时的隐藏属性 [英] Hidden property when exporting JasperReport

查看:330
本文介绍了导出JasperReport时的隐藏属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用jasper报告隐藏文本字段,所以当我在html中查看它时我不会看到它的内容,但问题是它必须在那里(proggram JAWS必须读它)所以我不能使用printWhenExpression。我尝试使用宽度属性来隐藏它,但到目前为止我没有效果。

I want to hide a text field using jasper report so when i will view it in html i wont see its content, but the problem is that it has to be there (proggram JAWS has to read it) so i can't use "printWhenExpression". I tried to use width properties to hide it but so far i have no effect.

        <textField>             
            <box>
                <topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                <leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                <bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
                <rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
            </box>
            <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
        </textField>


推荐答案

如果我理解正确,你需要保持形状框中的内容好像内容在这里,但你希望内容消失。

If I understood correctly, you need to keep the shape of the box as if the content was here, but you want the content to disappear.

确实 printWhenExpression 将使整个项目消失。

It's true that printWhenExpression will make the whole item disappear.

您可以:


  • 使用父项(例如框架)在textField周围,因此 printWhenExpression 在文本字段中为true,那么框架仍然是保持原状。

  • Use a parent item such as a frame to be around the textField, so printWhenExpression is true on the text fields, then the frame will still be here to keep its place.

    <frame>
        <reportElement x="0" y="0" width="200" height="200" uuid="25b397bf-e718-43ab-8641-4f7c7932253f"/>
        <textField>
            <reportElement x="0" y="0" width="100" height="30" uuid="4e8ea258-88f0-4220-a350-448da63390d1">
                <printWhenExpression><![CDATA[the_condition]]></printWhenExpression>
            </reportElement>
            <textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
        </textField>
    </frame>


  • 在文本字段中使用 java条件。如果条件为假,则文本将消失,但文本字段框仍将显示。

  • Use a java condition in your text field. If the condition is false, the text will disappear but the text field frame will still be displayed.

        <textField>
            <reportElement x="0" y="0" width="100" height="30" uuid="4e8ea258-88f0-4220-a350-448da63390d1">
                <printWhenExpression><![CDATA[the_condition]]></printWhenExpression>
            </reportElement>
            <textFieldExpression><![CDATA[my_condition ? $V{PAGE_NUMBER} : ""]]></textFieldExpression>
        </textField>
    


  • 这篇关于导出JasperReport时的隐藏属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆