alfpunk Posted June 29, 2020 Share Posted June 29, 2020 I tried to hide text field and next element table when there is no roleName via <printWhenExpression><![CDATA[!($F{roleName}.isEmpty())]]></printWhenExpression>. It's hide but I get a blank space insted it. How could I remove it? I tried to use isRemoveLineWhenBlank="true" and it literally not help me. Any idea? <frame> <reportElement positionType="Float" x="0" y="150" width="534" height="78" uuid="cd746329-1f2a-4185-89ef-c33ac81bb392"/> <staticText> <reportElement style="G_NS_12_Text_White_Box_TLBR_Green_Back_Green" positionType="Float" x="0" y="0" width="534" height="30" uuid="10ea4ac7-0d28-487e-a043-70e929b2cf8c"/> <text><![CDATA[someText1]]></text> </staticText> <componentElement> <reportElement positionType="Float" x="0" y="30" width="534" height="48" isRemoveLineWhenBlank="true" uuid="c244df2a-d81a-4399-8d19-41e3e46c8c2e"/> <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> <datasetRun subDataset="RoleCountryRagStatus" uuid="7b499b81-2ca6-4fed-aa01-d3409dc37a86"> <dataSourceExpression><![CDATA[$F{someDS}]]></dataSourceExpression> </datasetRun> <jr:column width="534" uuid="2510afd8-44c0-474c-87a1-cfe727fcd212"> <jr:detailCell height="48"> <textField> <reportElement style="G_NS_10_Text_White_Box_LR_DarkGrey_Back_DarkGrey" x="0" y="0" width="534" height="24" isRemoveLineWhenBlank="true" uuid="0fcd7730-f611-4f68-a175-3bd344cd7d40"> <printWhenExpression><![CDATA[!($F{roleName}.isEmpty())]]></printWhenExpression> </reportElement> <textFieldExpression><![CDATA["Role - " + $F{roleName}]]></textFieldExpression> </textField> <componentElement> <reportElement x="0" y="24" width="534" height="24" isRemoveLineWhenBlank="true" uuid="5772cb77-d4a5-4acc-8534-80549dde126f"> <printWhenExpression><![CDATA[!($F{roleName}.isEmpty())]]></printWhenExpression> </reportElement> <jr:table> <datasetRun subDataset="CountryRagStatus" uuid="e838cd1e-ea24-481a-ae9e-8385aaab65a0"> <datasetParameter name="REPORT_DATA_SOURCE"> <datasetParameterExpression><![CDATA[$F{someDS2}]]></datasetParameterExpression> </datasetParameter> <dataSourceExpression><![CDATA[$P{REPORT_CONNECTION}]]></dataSourceExpression> </datasetRun> <jr:column width="186" uuid="9357da0f-d58f-4345-8f9f-06e0b148791f"> <jr:detailCell height="24"> <textField> <reportElement style="G_OS_8Bold_Box_LBR_Grey" x="0" y="0" width="186" height="24" isRemoveLineWhenBlank="true" uuid="8931c6a8-0a0c-4eca-af60-a45fdc01f164"> <printWhenExpression><![CDATA[!($F{country}.isEmpty())]]></printWhenExpression> </reportElement> <textFieldExpression><![CDATA[$F{country}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="348" uuid="c885ba90-d68c-4f97-a843-f6f9bcd43cc1"> <jr:detailCell height="24"> <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.HorizontalRowLayout"/> <frame> <reportElement style="Box_LRB_Grey" x="0" y="0" width="348" height="24" isRemoveLineWhenBlank="true" uuid="a457d366-5e92-4588-be11-182d164a8db3"> <printWhenExpression><![CDATA[!($F{country}.isEmpty())]]></printWhenExpression> </reportElement> <ellipse> <reportElement style="RagStatus_Circle" x="8" y="8" width="8" height="8" uuid="5576e985-e59f-4a50-aad8-1a76e132a7cb"/> </ellipse> <textField> <reportElement style="OpenSans_8_LeftIndent_6_vTextAlign_Middle" x="16" y="0" width="332" height="24" uuid="500647a2-82a6-4037-a419-00bc74069a4d"/> <textFieldExpression><![CDATA[$F{ragStatus}]]></textFieldExpression> </textField> </frame> </jr:detailCell> </jr:column> </jr:table> </componentElement> </jr:detailCell> </jr:column> </jr:table> </componentElement> </frame> Link to comment Share on other sites More sharing options...
Solution alfpunk Posted July 1, 2020 Author Solution Share Posted July 1, 2020 When I change <jr:table> to <jr:list> all work correctly and it helps in my situation. Still have no idea why it's not working with tables. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now