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
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
10 Answers:
Posted on July 19, 2006 at 3:22pm
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
Also, on which band is the text field placed? Is it on the detail band?
Regards,
Lucian
Posted on July 19, 2006 at 3:33pm
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
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
Posted on July 19, 2006 at 3:34pm
Attaching file (had to change extension to .txt). [file name=certificate.txt size=40872]http://www.jasperforge.org/components/com_joomlaboard/uploaded/files/cer...
Posted on July 20, 2006 at 8:56am
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
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
Posted on September 14, 2006 at 2:12pm
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.
Here is my jrxml file if it helps.
Code: |
<br /> <?xml version="1.0" encoding="UTF-8" ?><br /> <!-- Created with iReport - A designer for JasperReports --><br /> <!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><br /> <jasperReport<br /> name="ac_diary_aircraft_totals"<br /> columnCount="1"<br /> printOrder="Vertical"<br /> orientation="Portrait"<br /> pageWidth="595"<br /> pageHeight="842"<br /> columnWidth="539"<br /> columnSpacing="0"<br /> leftMargin="28"<br /> rightMargin="28"<br /> topMargin="28"<br /> bottomMargin="28"<br /> whenNoDataType="NoPages"<br /> isTitleNewPage="false"<br /> isSummaryNewPage="false"<br /> whenResourceMissingType="Error"><br /> <property name="ireport.scriptlethandling" value="0" /><br /> <property name="ireport.encoding" value="UTF-8" /><br /> <import value="java.util.*" /><br /> <import value="net.sf.jasperreports.engine.*" /><br /> <import value="net.sf.jasperreports.engine.data.*" /><br /> <import value="java.text.*" /><br /> <br /> <parameter name="SQLWHERE" isForPrompting="true" class="java.lang.String"/><br /> <queryString><![CDATA[$P!{SQLWHERE}]]></queryString><br /> <br /> <field name="INTDIARYID" class="java.lang.Integer"/><br /> <field name="INTAIRCRAFTID" class="java.lang.Integer"/><br /> <field name="INTBASEID" class="java.lang.Integer"/><br /> <field name="INTOWNERBASEID" class="java.lang.Integer"/><br /> <field name="DATFROM" class="java.sql.Timestamp"/><br /> <field name="DATTO" class="java.sql.Timestamp"/><br /> <field name="STRFMV" class="java.lang.String"/><br /> <field name="STRINSURED" class="java.lang.String"/><br /> <field name="STRINSURER" class="java.lang.String"/><br /> <field name="STRFLEETNAME" class="java.lang.String"/><br /> <field name="STRBASENAME" class="java.lang.String"/><br /> <field name="STRBASENAME_OWNER" class="java.lang.String"/><br /> <field name="STRCOUNTRY" class="java.lang.String"/><br /> <field name="STRCOUNTRY_OWNER" class="java.lang.String"/><br /> <field name="STRFLEETCODE" class="java.lang.String"/><br /> <field name="STRREGISTRATION" class="java.lang.String"/><br /> <field name="DATFROMTIME" class="java.sql.Time"/><br /> <field name="DATTOTIME" class="java.sql.Time"/><br /> <field name="STRUNIT" class="java.lang.String"/><br /> <field name="STRUNIT_OWNER" class="java.lang.String"/><br /> <br /> <variable name="FLEETCOUNT" class="java.lang.Integer" resetType="Group" resetGroup="fleet_group" calculation="Nothing"><br /> <variableExpression><![CDATA[new Integer($V{FLEETCOUNT}.intValue() + 1)]]></variableExpression><br /> <initialValueExpression><![CDATA[new Integer(0)]]></initialValueExpression><br /> </variable><br /> <br /> <group name="base_group" ><br /> <groupExpression><![CDATA[$F{STRBASENAME}]]></groupExpression><br /> <groupHeader><br /> <band height="60" isSplitAllowed="true" ><br /> <rectangle><br /> <reportElement<br /> x="0"<br /> y="40"<br /> width="539"<br /> height="20"<br /> forecolor="#4C4C4C"<br /> backcolor="#ECE9E2"<br /> key="header_background-1"/><br /> <graphicElement stretchType="NoStretch" pen="2Point" fill="Solid" /><br /> </rectangle><br /> <textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" ><br /> <reportElement<br /> x="2"<br /> y="41"<br /> width="341"<br /> height="18"<br /> key="base_group_header"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement textAlignment="Left"><br /> <font size="12" isBold="true"/><br /> </textElement><br /> <textFieldExpression class="java.lang.String"><![CDATA[$F{STRBASENAME}]]></textFieldExpression><br /> </textField><br /> </band><br /> </groupHeader><br /> <groupFooter><br /> <band height="0" isSplitAllowed="true" ><br /> </band><br /> </groupFooter><br /> </group><br /> <group name="fleet_group" ><br /> <groupExpression><![CDATA[$F{STRFLEETCODE}]]></groupExpression><br /> <groupHeader><br /> <band height="30" isSplitAllowed="true" ><br /> <staticText><br /> <reportElement<br /> x="15"<br /> y="8"<br /> width="80"<br /> height="18"<br /> key="fleet_code_header"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement verticalAlignment="Middle"><br /> <font pdfFontName="Helvetica-Bold" size="12" isBold="true"/><br /> </textElement><br /> <text><![CDATA[Fleet Code]]></text><br /> </staticText><br /> <staticText><br /> <reportElement<br /> x="133"<br /> y="6"<br /> width="80"<br /> height="18"<br /> key="base_fleet_total"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement verticalAlignment="Middle"><br /> <font pdfFontName="Helvetica-Bold" size="12" isBold="true"/><br /> </textElement><br /> <text><![CDATA[Total]]></text><br /> </staticText><br /> </band><br /> </groupHeader><br /> <groupFooter><br /> <band height="25" isSplitAllowed="true" ><br /> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" ><br /> <reportElement<br /> x="133"<br /> y="3"<br /> width="100"<br /> height="18"<br /> key="base_fleet_count"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement><br /> <font/><br /> </textElement><br /> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{FLEETCOUNT}]]></textFieldExpression><br /> </textField><br /> </band><br /> </groupFooter><br /> </group><br /> <background><br /> <band height="0" isSplitAllowed="true" ><br /> </band><br /> </background><br /> <title><br /> <band height="48" isSplitAllowed="true" ><br /> <rectangle><br /> <reportElement<br /> x="0"<br /> y="0"<br /> width="539"<br /> height="48"<br /> forecolor="#4C4C4C"<br /> backcolor="#ECE9E2"<br /> key="header_background"/><br /> <graphicElement stretchType="NoStretch" pen="2Point" fill="Solid" /><br /> </rectangle><br /> <image scaleImage="RetainShape" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" ><br /> <reportElement<br /> x="3"<br /> y="4"<br /> width="146"<br /> height="40"<br /> key="bristow_image"<br /> isPrintRepeatedValues="false"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <graphicElement stretchType="NoStretch" pen="None"/><br /> <imageExpression class="java.lang.String"><![CDATA["http://intops.bristow.co.uk/intops_prod/images/bristow_lofi.gif"]]></imageExpression><br /> </image><br /> <staticText><br /> <reportElement<br /> x="175"<br /> y="16"<br /> width="189"<br /> height="27"<br /> key="report_header"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement verticalAlignment="Bottom"><br /> <font pdfFontName="Helvetica-Bold" size="18" isBold="true"/><br /> </textElement><br /> <text><![CDATA[Aircraft Totals Report]]></text><br /> </staticText><br /> </band><br /> </title><br /> <pageHeader><br /> <band height="0" isSplitAllowed="false" ><br /> </band><br /> </pageHeader><br /> <columnHeader><br /> <band height="0" isSplitAllowed="true" ><br /> </band><br /> </columnHeader><br /> <detail><br /> <band height="20" isSplitAllowed="true" ><br /> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Column" hyperlinkType="None" hyperlinkTarget="Self" ><br /> <reportElement<br /> mode="Transparent"<br /> x="13"<br /> y="1"<br /> width="84"<br /> height="18"<br /> key="fleet_code_detail"<br /> isPrintRepeatedValues="false"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement><br /> <font/><br /> </textElement><br /> <textFieldExpression class="java.lang.String"><![CDATA[$F{STRFLEETCODE}]]></textFieldExpression><br /> </textField><br /> </band><br /> </detail><br /> <columnFooter><br /> <band height="0" isSplitAllowed="true" ><br /> </band><br /> </columnFooter><br /> <pageFooter><br /> <band height="35" isSplitAllowed="true" ><br /> <textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" ><br /> <reportElement<br /> x="212"<br /> y="9"<br /> width="114"<br /> height="16"<br /> key="textField"/><br /> <box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/><br /> <textElement textAlignment="Center"><br /> <font/><br /> </textElement><br /> <textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression><br /> </textField><br /> </band><br /> </pageFooter><br /> <summary><br /> <band height="0" isSplitAllowed="true" ><br /> </band><br /> </summary><br /> </jasperReport><br /> <br /> </td></tr></tbody></table><br>Post edited by: Webby, at: 2006/09/14 14:24 |
Posted on September 14, 2006 at 3:37pm
Are you using JR 1.2.6? If so, this is due to a [url=http://jasperforge.org/sf/go/artf1563?nav=1]bug introduced in this release.
Regards,
Lucian
Regards,
Lucian
Posted on September 15, 2006 at 8:20am
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? ;)
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? ;)
Posted on September 19, 2006 at 9:37am
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!! ;)
Any help is much appreciated as I have a boss who wants reports very soon!! ;)