print when for the last page with detail records

Hello community,

I try to hide a field in the column footer on the last page with detail records. I thought if I create an integer variable PageCount_SUM with sum calculation and as expression $V{PAGE_COUNT}, then it will be possible to use the print when expression: $V{REPORT_COUNT}!=$V{PageCount_SUM}. But this does not work.

After previewing the report I know that the report has 14 records on the first page, +17(31) on the second, + 17(48) on the third and +2(50) on the fourth page.

If the print when expression is hard coded like $V{REPORT_COUNT}!=50 or $V{PageCount_SUM}!=50 I will have what I want, but not when I use $V{REPORT_COUNT}!=$V{PageCount_SUM}.

Does anybody have experience with this issue and want to give me a hint how to do it? Or maybe you know another way to do that? Thank you :)

Here is the report using  Jaspersoft Studio 5.5, the Sample DB and groovy, just paste and copy to test it. I need Help :)

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version last-->
<jasperReport xmlns="" xmlns:xsi="" xsi:schemaLocation="" name="PrintWhenLastDetailPage" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="5ed3c130-043e-4bcb-bb9b-599e9d76ab00">
    <property name="" value="Sample DB"/>
    <queryString language="SQL">
        <![CDATA[select firstname, lastname, street, city
from address]]>
    <field name="FIRSTNAME" class="java.lang.String"/>
    <field name="LASTNAME" class="java.lang.String"/>
    <field name="STREET" class="java.lang.String"/>
    <field name="CITY" class="java.lang.String"/>
    <variable name="RecordPos_COUNT" class="java.lang.Integer" calculation="Count">
    <variable name="PageCount_SUM" class="java.lang.Integer" incrementType="Page" calculation="Sum">
        <band splitType="Stretch"/>
        <band height="79" splitType="Stretch"/>
        <band height="35" splitType="Stretch"/>
        <band height="61" splitType="Stretch">
                <reportElement x="40" y="2" width="101" height="30" uuid="726ded3a-dee6-4172-8a9b-2e48416794a5"/>
                <reportElement x="141" y="2" width="138" height="30" uuid="e1e4d9da-aab5-447c-89b5-dd5c34c09997"/>
                <reportElement x="279" y="2" width="138" height="30" uuid="18decfc1-65ed-49d9-93a1-0770c2674bda"/>
                <reportElement x="417" y="2" width="138" height="30" uuid="717a4c67-c255-4448-9945-e62d4e0a18ae"/>
                <reportElement x="0" y="0" width="40" height="30" uuid="544db95f-2469-456e-9250-e7a4bea75b2b"/>
        <band height="35" splitType="Stretch">
                <reportElement x="40" y="0" width="101" height="30" uuid="c845a013-6f55-44b1-bb49-5db46c442fb5"/>
                <reportElement x="141" y="0" width="138" height="30" uuid="e8ae0655-0b2c-4bb5-a3c1-f2357c526e16"/>
                <reportElement x="279" y="0" width="138" height="30" uuid="02677fe9-123e-48f9-b34c-8c7cf0f23a02"/>
                <reportElement x="416" y="0" width="138" height="30" uuid="aacaee2a-8c76-4c1c-b153-2cb0a6e94334"/>
                <reportElement x="0" y="0" width="40" height="30" uuid="ed6c6a13-b25b-46c2-b017-7c66663d4b4a"/>
        <band height="52" splitType="Stretch">
                <reportElement mode="Opaque" x="0" y="0" width="220" height="20" forecolor="#000000" backcolor="#FFFF00" uuid="4b088258-01cc-42cb-9d90-213783076f61">
                <text><![CDATA[Please hide me just on the last page with records]]></text>
        <band height="54" splitType="Stretch"/>
        <band height="46" splitType="Stretch">
            <textField isStretchWithOverflow="true">
                <reportElement x="0" y="0" width="141" height="30" uuid="9fb1b703-dbd7-4f5b-87c5-e824a90b0da4"/>
                <textFieldExpression><![CDATA["Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable English. Many desktop publishing packages and web page editors now use Lorem Ipsum as their default model text, and a search for 'lorem ipsum' will uncover many web sites still in their infancy. Various versions have evolved over the years, sometimes by accident, sometimes on purpose (injected humour and the like).Contrary to popular belief, Lorem Ipsum is not simply random text. It has roots in a piece of classical Latin literature from 45 BC, making it over 2000 years old. \n\n Richard McClintock, a Latin professor at Hampden-Sydney College in Virginia, looked up one of the more obscure Latin words, consectetur, from a Lorem Ipsum passage, and going through the cites of the word in classical literature, discovered the undoubtable source. Lorem Ipsum comes from sections 1.10.32 and 1.10.33 of de Finibus Bonorum et Malorum (The Extremes of Good and Evil) by Cicero, written in 45 BC. This book is a treatise on the theory of ethics, very popular during the Renaissance. The first line of Lorem Ipsum, Lorem ipsum dolor sit amet.., comes from a line in section 1.10.32.The standard chunk of Lorem Ipsum used since the 1500s is reproduced below for those interested. Sections 1.10.32 and 1.10.33 from de Finibus Bonorum et Malorum by Cicero are also reproduced in their exact original form, accompanied by English versions from the 1914 translation by H. Rackham."]]></textFieldExpression>


mariuss's picture
Joined: Aug 11 2013 - 2:33pm
Last seen: 9 years 8 months ago

0 Answers:

No answers yet