How to hide details only if there is a single value

0

Hi guys, I having a problem to hide the details band. I have two Items, one have single value and the other one have multiple values. I want to hide the one only contain single value. but the multiple value data should show details on details band. 

https://gyazo.com/66478688cfb0bb0accc4be1e40232d78

I want  to hide the detail for item 335 only.

 

Please help !!

jing_3's picture
2
Joined: Mar 23 2020 - 2:41pm
Last seen: 2 months 4 days ago

Can you show me the code of that block?

I am Leo - 2 months 5 days ago

    <detail>
        <band height="15">
            <property name="com.jaspersoft.studio.unit.height" value="px"/>
            <printWhenExpression><![CDATA[$F{Color}  !=  null && !$F{Color}.isEmpty()]]></printWhenExpression>
            <textField>
                <reportElement mode="Opaque" x="0" y="0" width="226" height="15" backcolor="#D1D1D1" uuid="1eda2882-4f8a-4671-8ced-94b745d301eb">
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                    <property name="com.jaspersoft.studio.unit.y" value="px"/>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font fontName="Arial"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{Color} + " / " + $F{Size}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement mode="Opaque" x="149" y="0" width="100" height="15" backcolor="#D1D1D1" uuid="9c6c5d40-5289-44f4-aaae-9394c07f22a9">
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                    <property name="com.jaspersoft.studio.unit.y" value="px"/>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font fontName="Arial"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{Sub_Stock}]]></textFieldExpression>
            </textField>
        </band>
    </detail>

Right now, I just set the condition to $F{Color}  !=  null && !$F{Color}.isEmpty(), but what I really want is to hide data that only contains single values.

Thanks

jing_3 - 2 months 5 days ago

0 Answers:

No answers yet
Feedback