Jump to content

How to use splitType in order avoid space in between when components are dynamically not visible in jasper?


Jasper learner

Recommended Posts

I've some 11 staticText components here. when I display only first and eight components I see a huge gap between them. I don't have any space between each component. 
My assumption is 'isRemoveLineWhenBlank="true"' on a component will allow the next component to display in its place if it's not getting displayed. But that's not happening here.

Below is the jasper reports version used:

   

 <dependency>         <groupId>net.sf.jasperreports</groupId>         <artifactId>jasperreports-fonts</artifactId>         <version>6.0.0</version>    </dependency>[/code]

Below is the code:

    <?xml version="1.0" encoding="UTF-8"?>    <!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0  -->    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="sample" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="acaa0a15-dc0f-462c-8d16-14f0b7325696">        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>        <summary>            <band height="581" splitType="Prevent">                <staticText>                    <reportElement positionType="Float" x="0" y="19" width="381" height="41" isRemoveLineWhenBlank="true" uuid="9547d877-993c-4bb4-becc-cf70a0cc1bc2">                        <printWhenExpression><![CDATA[true]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[Text11111111111111111111]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="60" width="381" height="41" isRemoveLineWhenBlank="true" uuid="9e7dbe2e-2fed-41c8-82ce-c0c6886c8eda">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[Text22222222222222222]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="100" width="381" height="41" isRemoveLineWhenBlank="true" uuid="75d03d01-ae6f-40e3-92d4-bed93a7cf671">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[Text3333333333333]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="260" width="381" height="41" isRemoveLineWhenBlank="true" uuid="d351c771-3c5f-4318-9a47-9363831908b6">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[7777777777777777777]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="140" width="381" height="41" isRemoveLineWhenBlank="true" uuid="cfa2937f-8ddd-4608-95e5-f3ec1d0dbea2">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[4444444444444444444]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="180" width="381" height="41" isRemoveLineWhenBlank="true" uuid="9e69343a-e1e7-4af9-90ae-d5d7c128a30a">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[55555555555555555555555]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="220" width="381" height="41" isRemoveLineWhenBlank="true" uuid="63d16d03-d637-406c-b128-06e8741a927f">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[66666666666666666]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="300" width="381" height="41" isRemoveLineWhenBlank="true" uuid="2f7e0222-a2be-47ff-be3c-3d404c40ab1c">                        <printWhenExpression><![CDATA[true]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[888888888888888888]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="340" width="381" height="41" isRemoveLineWhenBlank="true" uuid="d87a01b5-f041-4c41-83e9-57b2e350f5b2">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[999999999999999999999999]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="380" width="381" height="41" isRemoveLineWhenBlank="true" uuid="b2017166-a731-4ebf-86f9-42a9dfe9d95a">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[1010101010101010]]></text>                </staticText>                <staticText>                    <reportElement positionType="Float" x="0" y="420" width="381" height="41" isRemoveLineWhenBlank="true" uuid="65c6b70e-7e12-4d38-b9d3-b9456e77c1e7">                        <printWhenExpression><![CDATA[false]]></printWhenExpression>                    </reportElement>                    <text><![CDATA[11 11 11 11 11 11 11 11 11 11 11 ]]></text>                </staticText>            </band>        </summary>    </jasperReport>[/code]

The output is same for splitType "Prevent" and "Stretch". Please help.

I've posted the same question in stackoverflow too. It can be referred for diagramatic representation.

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...