dcherk Posted July 19, 2006 Share Posted July 19, 2006 Greetings... I created the textField below: <textField isStretchWithOverflow="true" pattern="¤ #,##0" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="283" y="0" width="55" height="14" forecolor="#000000" backcolor="#FFFFFF" key="deductible" positionType="Float" isPrintRepeatedValues="false" printWhenGroupChanges="Coverage" isPrintWhenDetailOverflows="true"> <printWhenExpression><![CDATA[new Boolean( $F{application_type}.equals( "group" ) )]]></printWhenExpression> </reportElement> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Right" verticalAlignment="Top" rotation="None" lineSpacing="Single"> <font fontName="Arial" pdfFontName="Helvetica" size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" pdfEncoding ="Cp1252" isStrikeThrough="false" /> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{deductible} == null ? "NONE" : new DecimalFormat( "$ #####" ).format( $F{deductible} )]]></textFieldExpression> </textField> The key items to note are: - isPrintRepeatedValues="false" - <textFieldExpression class="java.lang.String"><![CDATA[$F{deductible} == null ? "NONE" : new DecimalFormat( "$ #####" ).format( $F{deductible} )]]></textFieldExpression> Even though, printing repeated values is false, the text "NONE" is repeated... I am using JasperReports 1.2.4, and the snippet above was created by iReport 1.2.4. Any suggestions? Thanks in advance, Dave Cherkassky VP of Software Development DJiNN Software Inc Link to comment Share on other sites More sharing options...
lucianc Posted July 19, 2006 Share Posted July 19, 2006 You have printWhenGroupChanges="Coverage" set for your text field. Is this group changing when "NONE" gets repeated? Could you try removing this and see whether the text still gets repeated? Also, on which band is the text field placed? Is it on the detail band? Regards,Lucian Link to comment Share on other sites More sharing options...
dcherk Posted July 19, 2006 Author Share Posted July 19, 2006 Lucian, thanks for looking at this issue. Answers to your questions:>> You have printWhenGroupChanges="Coverage" set for your text field. Is this group changing when "NONE" gets repeated? No, this group does not change >> Could you try removing this and see whether the text still gets repeated? I tried this, no effect. >>Also, on which band is the text field placed? Is it on the detail band? Yes, the detail band. In this new forum, I can now attach the entire file. Thanks for your help, and sorry for the duplicate posts,Dave Cherkassky Link to comment Share on other sites More sharing options...
dcherk Posted July 19, 2006 Author Share Posted July 19, 2006 Attaching file (had to change extension to .txt). [file name=certificate.txt size=40872]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/certificate.txt[/file] Link to comment Share on other sites More sharing options...
lucianc Posted July 19, 2006 Share Posted July 19, 2006 Which JR version are you using? I'm not able to reproduce this.. I don't have your data, do you think it would be possible to somehow isolate the issue and replicate it with some static data? Regards,Lucian Link to comment Share on other sites More sharing options...
Teodor Danciu Posted July 20, 2006 Share Posted July 20, 2006 Hi, This is a quote from the Ultimate Guide: "The isPrintRepeatedValues attribute works only if the corresponding <printWhenExpression> is missing. If it is not missing, it will always dictate whether the element should be printed, regardless of the repeating values." I hope this helps.Teodor Link to comment Share on other sites More sharing options...
Webby Posted September 14, 2006 Share Posted September 14, 2006 I'm having a similar problem and do not have anything in my printWhenExpression field. My report uses two groups and the FIELD that I'm having problems with is in the detail band. Here is my jrxml file if it helps. Code:<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="ac_diary_aircraft_totals" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="539" columnSpacing="0" leftMargin="28" rightMargin="28" topMargin="28" bottomMargin="28" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false" whenResourceMissingType="Error"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <import value="java.text.*" /> <parameter name="SQLWHERE" isForPrompting="true" class="java.lang.String"/> <queryString><![CDATA[$P!{SQLWHERE}]]></queryString> <field name="INTDIARYID" class="java.lang.Integer"/> <field name="INTAIRCRAFTID" class="java.lang.Integer"/> <field name="INTBASEID" class="java.lang.Integer"/> <field name="INTOWNERBASEID" class="java.lang.Integer"/> <field name="DATFROM" class="java.sql.Timestamp"/> <field name="DATTO" class="java.sql.Timestamp"/> <field name="STRFMV" class="java.lang.String"/> <field name="STRINSURED" class="java.lang.String"/> <field name="STRINSURER" class="java.lang.String"/> <field name="STRFLEETNAME" class="java.lang.String"/> <field name="STRBASENAME" class="java.lang.String"/> <field name="STRBASENAME_OWNER" class="java.lang.String"/> <field name="STRCOUNTRY" class="java.lang.String"/> <field name="STRCOUNTRY_OWNER" class="java.lang.String"/> <field name="STRFLEETCODE" class="java.lang.String"/> <field name="STRREGISTRATION" class="java.lang.String"/> <field name="DATFROMTIME" class="java.sql.Time"/> <field name="DATTOTIME" class="java.sql.Time"/> <field name="STRUNIT" class="java.lang.String"/> <field name="STRUNIT_OWNER" class="java.lang.String"/> <variable name="FLEETCOUNT" class="java.lang.Integer" resetType="Group" resetGroup="fleet_group" calculation="Nothing"> <variableExpression><![CDATA[new Integer($V{FLEETCOUNT}.intValue() + 1)]]></variableExpression> <initialValueExpression><![CDATA[new Integer(0)]]></initialValueExpression> </variable> <group name="base_group" > <groupExpression><![CDATA[$F{STRBASENAME}]]></groupExpression> <groupHeader> <band height="60" isSplitAllowed="true" > <rectangle> <reportElement x="0" y="40" width="539" height="20" forecolor="#4C4C4C" backcolor="#ECE9E2" key="header_background-1"/> <graphicElement stretchType="NoStretch" pen="2Point" fill="Solid" /> </rectangle> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="2" y="41" width="341" height="18" key="base_group_header"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Left"> <font size="12" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{STRBASENAME}]]></textFieldExpression> </textField> </band> </groupHeader> <groupFooter> <band height="0" isSplitAllowed="true" > </band> </groupFooter> </group> <group name="fleet_group" > <groupExpression><![CDATA[$F{STRFLEETCODE}]]></groupExpression> <groupHeader> <band height="30" isSplitAllowed="true" > <staticText> <reportElement x="15" y="8" width="80" height="18" key="fleet_code_header"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Middle"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true"/> </textElement> <text><![CDATA[Fleet Code]]></text> </staticText> <staticText> <reportElement x="133" y="6" width="80" height="18" key="base_fleet_total"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Middle"> <font pdfFontName="Helvetica-Bold" size="12" isBold="true"/> </textElement> <text><![CDATA[Total]]></text> </staticText> </band> </groupHeader> <groupFooter> <band height="25" isSplitAllowed="true" > <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="133" y="3" width="100" height="18" key="base_fleet_count"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{FLEETCOUNT}]]></textFieldExpression> </textField> </band> </groupFooter> </group> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="48" isSplitAllowed="true" > <rectangle> <reportElement x="0" y="0" width="539" height="48" forecolor="#4C4C4C" backcolor="#ECE9E2" key="header_background"/> <graphicElement stretchType="NoStretch" pen="2Point" fill="Solid" /> </rectangle> <image scaleImage="RetainShape" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="3" y="4" width="146" height="40" key="bristow_image" isPrintRepeatedValues="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <graphicElement stretchType="NoStretch" pen="None"/> <imageExpression class="java.lang.String"><![CDATA["http://intops.bristow.co.uk/intops_prod/images/bristow_lofi.gif"]]></imageExpression> </image> <staticText> <reportElement x="175" y="16" width="189" height="27" key="report_header"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement verticalAlignment="Bottom"> <font pdfFontName="Helvetica-Bold" size="18" isBold="true"/> </textElement> <text><![CDATA[Aircraft Totals Report]]></text> </staticText> </band> </title> <pageHeader> <band height="0" isSplitAllowed="false" > </band> </pageHeader> <columnHeader> <band height="0" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="20" isSplitAllowed="true" > <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Column" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement mode="Transparent" x="13" y="1" width="84" height="18" key="fleet_code_detail" isPrintRepeatedValues="false"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement> <font/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[$F{STRFLEETCODE}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="0" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="35" isSplitAllowed="true" > <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="212" y="9" width="114" height="16" key="textField"/> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/> <textElement textAlignment="Center"> <font/> </textElement> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression> </textField> </band> </pageFooter> <summary> <band height="0" isSplitAllowed="true" > </band> </summary></jasperReport>Post edited by: Webby, at: 2006/09/14 14:24 Link to comment Share on other sites More sharing options...
lucianc Posted September 14, 2006 Share Posted September 14, 2006 Are you using JR 1.2.6? If so, this is due to a bug introduced in this release. Regards,Lucian Link to comment Share on other sites More sharing options...
Webby Posted September 15, 2006 Share Posted September 15, 2006 Yes, I am using version 1.2.6 of Jasper Reports. It's a pity because I had just downloaded the latest version source and compiled it using ANT in order to fix the SQL alias problem we were having. :lol: Never mind at least it won't take me that long this time. Newbie Java users! What are they like? ;) Link to comment Share on other sites More sharing options...
Webby Posted September 19, 2006 Share Posted September 19, 2006 I have downloaded version 1.2.5 of jasper reports and put this into my ireport lib folder. I have also set the compatibility back to version 1.2.5 on iReport. Unfortunately this has not fixed the 'Print Repeated Values' bug. How many versions do I have to go back or what else do I need to do in order get this working. Any help is much appreciated as I have a boss who wants reports very soon!! ;) Link to comment Share on other sites More sharing options...
lucianc Posted September 19, 2006 Share Posted September 19, 2006 The bug was introduced in 1.2.6, so it should work in 1.2.5. Did you remove the 1.2.6 jar from the classpath? 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