Jump to content
Changes to the Jaspersoft community edition download ×

Remove Line When Blank / Show only Distinct Values in a Field


zgadson

Recommended Posts

Hello,

Having trouble in Jasper Studio Professional getting my report to remove duplicate values/lines. I can hide duplicate values, but I want the entire line to go away. I'm very computer literate, but this has been frustrating me for over a week now. ANY help anyone can give me would be greatly appreciated.

The Load Number would otherwise be repeated, but where it's not repeated, I want the whole line to disappear with it. Additionally, the repeated lines only appeared once I'd added the Status Activity field to my report. I imagine it's becuase there are multiple status updates for every load. That said, having a report to only show the most recent status update is my ultimate goal.

Here is my code:

    <![CDATA[        <query>            <queryFields>                <queryField id="Load.LoadNum"/>                <queryField id="Load.LoadTmsStatus"/>                <queryField id="Load.DateTime_PlannedStart"/>                <queryField id="Load.TransportModeName"/>                <queryField id="Load.TradingPartnerName"/>                <queryField id="Load.ProNum"/>                <queryField id="LoadStatusActivity.LoadStatusComment"/>            </queryFields>            <groupList>                <group columnName="Load.LoadNum"/>            </groupList>            <queryFilterString> Load.LoadTmsStatus == 'InTransit'</queryFilterString>            <sortList>                <sortColumn columnName="Load.LoadNum" ascending="false"/>            </sortList>        </query>]]>    </queryString>    <field name="Load.LoadNum" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="LoadNum"/>        <property name="com.jaspersoft.studio.field.tree.path" value="Load"/>        <fieldDescription><![CDATA[LoadNum]]></fieldDescription>    </field>    <field name="Load.LoadTmsStatus" class="java.lang.String">        <property name="com.jaspersoft.studio.field.label" value="LoadTmsStatus"/>        <property name="com.jaspersoft.studio.field.tree.path" value="Load"/>        <fieldDescription><![CDATA[LoadTmsStatus]]></fieldDescription>    </field>    <field name="Load.DateTime_PlannedStart" class="java.sql.Timestamp">        <fieldDescription><![CDATA[DateTime_PlannedStart]]></fieldDescription>    </field>    <field name="Load.TransportModeName" class="java.lang.String">        <fieldDescription><![CDATA[TransportModeName]]></fieldDescription>    </field>    <field name="Load.TradingPartnerName" class="java.lang.String">        <fieldDescription><![CDATA[TradingPartnerName]]></fieldDescription>    </field>    <field name="Load.TradingPartnerNameClient1" class="java.lang.String">        <fieldDescription><![CDATA[TradingPartnerNameClient]]></fieldDescription>    </field>    <field name="Load.ProNum" class="java.lang.String">        <fieldDescription><![CDATA[ProNum]]></fieldDescription>    </field>    <field name="LoadStatusActivity.LoadStatusComment" class="java.lang.String">        <fieldDescription><![CDATA[LoadStatusComment]]></fieldDescription>    </field>    <group name="Load.LoadNum">        <groupExpression><![CDATA[$F{Load.LoadNum}]]></groupExpression>    </group>    <background>        <band splitType="Stretch"/>    </background>    <title>        <band splitType="Stretch">            <property name="com.jaspersoft.studio.unit.height" value="px"/>        </band>    </title>    <pageHeader>        <band splitType="Stretch">            <property name="com.jaspersoft.studio.unit.height" value="px"/>        </band>    </pageHeader>    <columnHeader>        <band height="31" splitType="Stretch">            <staticText>                <reportElement x="0" y="0" width="100" height="30" uuid="f8fe60df-56a6-47f0-b6e3-fe27dce35ae4">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="d6081118-b3b9-44e3-82f9-49f9752636d6"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[Load Number]]></text>            </staticText>            <staticText>                <reportElement x="110" y="0" width="60" height="30" uuid="2e421488-984f-47ed-a999-90e7aab70bdf">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="7a46d7c2-ec8e-453a-8b54-c07efaa6ecd1"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[status]]></text>            </staticText>            <staticText>                <reportElement x="180" y="1" width="100" height="30" uuid="4ff99f5c-cc2b-432e-a2a9-0c4afd390ee8">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="da67e068-402b-4c32-9847-49c595ea136b"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[ship Date]]></text>            </staticText>            <staticText>                <reportElement x="290" y="1" width="40" height="30" uuid="d8e576c5-3db7-44f8-ade0-3b14c61b0d91">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="44f34002-76e5-44a4-8cdb-25d651056efd"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[Mode]]></text>            </staticText>            <staticText>                <reportElement x="340" y="1" width="80" height="30" uuid="03da95b7-2e6a-4bd6-b3cf-4674fb950648">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a691234a-7f02-46b3-8e05-eaf074615f20"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[Carrier]]></text>            </staticText>            <staticText>                <reportElement x="430" y="0" width="100" height="30" uuid="91fc1200-61ef-4de7-a8b7-76fc99fe09ca">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="9b44bd07-d3a2-42a9-bbed-95dc0c848d7a"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="14" isBold="true"/>                </textElement>                <text><![CDATA[PRO Number]]></text>            </staticText>            <staticText>                <reportElement x="540" y="1" width="120" height="30" uuid="49fea68c-493a-4d34-8420-6b867b2bc913">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="18f91241-8124-4328-9d8e-0276a5c9f095"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font size="15" isBold="true"/>                </textElement>                <text><![CDATA[status Comment]]></text>            </staticText>        </band>    </columnHeader>    <detail>        <band height="20" splitType="Stretch">            <textField>                <reportElement x="110" y="0" width="60" height="20" uuid="39325141-d433-49b4-bfd0-0ef23b43a572">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="7a46d7c2-ec8e-453a-8b54-c07efaa6ecd1"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Load.LoadTmsStatus}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="180" y="1" width="100" height="19" uuid="21d2ce70-0843-4daa-955d-ec4c36fb0d69">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="da67e068-402b-4c32-9847-49c595ea136b"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Load.DateTime_PlannedStart}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="290" y="0" width="40" height="19" uuid="6aecbc3d-8d7b-4a38-86c6-28a66f3528a5">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="44f34002-76e5-44a4-8cdb-25d651056efd"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Load.TransportModeName}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="340" y="0" width="80" height="19" uuid="7acb49e0-e24f-4a8d-a91c-4320aea07fe2">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a691234a-7f02-46b3-8e05-eaf074615f20"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Load.TradingPartnerName}]]></textFieldExpression>            </textField>            <textField isBlankWhenNull="true">                <reportElement x="430" y="0" width="100" height="19" uuid="6a837c7a-0cbc-41b6-83a0-244f76b6ca3c">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="9b44bd07-d3a2-42a9-bbed-95dc0c848d7a"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Load.ProNum}]]></textFieldExpression>            </textField>            <textField isBlankWhenNull="false">                <reportElement x="540" y="1" width="120" height="19" uuid="38b8fa9b-8a0d-418d-8609-f3929a57c701">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="18f91241-8124-4328-9d8e-0276a5c9f095"/>                    <property name="net.sf.jasperreports.style.isBlankWhenNull" value="true"/>                    <property name="net.sf.jasperreports.consume.space.on.overflow" value="true"/>                    <property name="net.sf.jasperreports.print.keep.full.text" value="true"/>                    <property name="net.sf.jasperreports.text.save.line.breaks" value="true"/>                    <property name="net.sf.jasperreports.text.truncate.at.char" value="true"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{LoadStatusActivity.LoadStatusComment}]]></textFieldExpression>            </textField>            <textField>                <reportElement isPrintRepeatedValues="false" x="0" y="0" width="100" height="20" isRemoveLineWhenBlank="true" uuid="209d6e81-5584-4245-94c0-b3d674af29bb">                    <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="d6081118-b3b9-44e3-82f9-49f9752636d6"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Load.LoadNum}]]></textFieldExpression>            </textField>        </band>    </detail>    <columnFooter>        <band splitType="Stretch">            <property name="com.jaspersoft.studio.unit.height" value="px"/>        </band>    </columnFooter>    <pageFooter>        <band splitType="Stretch">            <property name="com.jaspersoft.studio.unit.height" value="px"/>        </band>    </pageFooter>    <summary>        <band splitType="Stretch">            <property name="com.jaspersoft.studio.unit.height" value="px"/>        </band>    </summary></jasperReport>[/code]

 

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...