icccapital Posted June 29, 2012 Share Posted June 29, 2012 I have put several text fields in the page header band and shrunk them down to near 0 height. I then put them to stretch on overflow. The reason for this is to create an address, phone, fax...etc without having a lot of whitespace if an address is not provided or the phone number is not provided. so the text fields have conditional line breaks( "\n").All works well, but now when they expand they are increasing the size of the page header. There are no controls below these controls, but there are controls to the right. The ones on the right do not move, but the whitespace below the text field controls do. I know this because I put a box around the last text field control and it is well above the bottom of the page header band.Is there anything that can be done about this? Code:<?xml version="1.0" encoding="UTF-8"?><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="ClientReportsSummary" language="groovy" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="fc68a490-ccb6-4504-a00b-0f19b73a0668"> <property name="ireport.zoom" value="1.0"/> <property name="ireport.x" value="0"/> <property name="ireport.y" value="0"/> <parameter name="SUBREPORT_DIR" class="java.lang.String" isForPrompting="false"> <defaultValueExpression><![CDATA["C:\\Users\\upjohs.xp\\My Documents\\NetbeansProjects\\JSFTest_2_1\\src\\java\\jasperreports\\"]]></defaultValueExpression> </parameter> <queryString> <![CDATA[]]> </queryString> <field name="contactAddress" class="java.lang.String"> <fieldDescription><![CDATA[contactAddress]]></fieldDescription> </field> <field name="contactAddress2" class="java.lang.String"> <fieldDescription><![CDATA[contactAddress2]]></fieldDescription> </field> <field name="contactCity" class="java.lang.String"> <fieldDescription><![CDATA[contactCity]]></fieldDescription> </field> <field name="class" class="java.lang.Class"> <fieldDescription><![CDATA[class]]></fieldDescription> </field> <field name="contactCompanyName" class="java.lang.String"> <fieldDescription><![CDATA[contactCompanyName]]></fieldDescription> </field> <field name="contactEmailAddress" class="java.lang.String"> <fieldDescription><![CDATA[contactEmailAddress]]></fieldDescription> </field> <field name="contactFax" class="java.lang.String"> <fieldDescription><![CDATA[contactFax]]></fieldDescription> </field> <field name="contactFirstName" class="java.lang.String"> <fieldDescription><![CDATA[contactFirstName]]></fieldDescription> </field> <field name="contactLastName" class="java.lang.String"> <fieldDescription><![CDATA[contactLastName]]></fieldDescription> </field> <field name="contactPhoneNumber" class="java.lang.String"> <fieldDescription><![CDATA[contactPhoneNumber]]></fieldDescription> </field> <field name="contactState" class="java.lang.String"> <fieldDescription><![CDATA[contactState]]></fieldDescription> </field> <field name="contactZipCode" class="java.lang.String"> <fieldDescription><![CDATA[contactZipCode]]></fieldDescription> </field> <field name="clientAddress" class="java.lang.String"> <fieldDescription><![CDATA[clientAddress]]></fieldDescription> </field> <field name="clientAddress2" class="java.lang.String"> <fieldDescription><![CDATA[clientAddress2]]></fieldDescription> </field> <field name="clientCity" class="java.lang.String"> <fieldDescription><![CDATA[clientCity]]></fieldDescription> </field> <field name="clientCode" class="java.lang.String"> <fieldDescription><![CDATA[clientCode]]></fieldDescription> </field> <field name="clientName" class="java.lang.String"> <fieldDescription><![CDATA[clientName]]></fieldDescription> </field> <field name="clientNumBooks" class="java.lang.Integer"> <fieldDescription><![CDATA[clientNumBooks]]></fieldDescription> </field> <field name="clientServicePerson" class="java.lang.String"> <fieldDescription><![CDATA[clientServicePerson]]></fieldDescription> </field> <field name="clientState" class="java.lang.String"> <fieldDescription><![CDATA[clientState]]></fieldDescription> </field> <field name="clientZipCode" class="java.lang.String"> <fieldDescription><![CDATA[clientZipCode]]></fieldDescription> </field> <field name="specialNotes" class="java.lang.String"> <fieldDescription><![CDATA[specialNotes]]></fieldDescription> </field> <field name="clientList" class="java.util.List"> <fieldDescription><![CDATA[clientList]]></fieldDescription> </field> <pageHeader> <band height="101" splitType="Prevent"> <staticText> <reportElement uuid="9cb6b6bd-b670-4ea0-a98e-ce0ca6422cd7" x="0" y="0" width="49" height="14" forecolor="#3399FF"/> <textElement/> <text><![CDATA[Contact:]]></text> </staticText> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement uuid="35aed98f-5430-4913-9e10-1f1a92c957f1" x="0" y="14" width="100" height="0"> <printWhenExpression><![CDATA[$F{contactCompanyName} != null && $F{contactCompanyName}.compareTo("") != 0]]></printWhenExpression> </reportElement> <textElement/> <textFieldExpression><![CDATA[$F{contactCompanyName}]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement uuid="bb5a6f92-2f5d-45ad-9fca-78c906676e4b" positionType="Float" x="0" y="16" width="100" height="0"/> <textElement/> <textFieldExpression><![CDATA[$F{contactAddress} + ($F{contactAddress2} != null && $F{contactAddress2}.compareTo("") != 0 ? "\n" + $F{contactAddress2} : "")]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement uuid="c40ed505-58a0-48f9-a629-bf15d8384c9f" positionType="Float" x="0" y="18" width="100" height="0"/> <textElement/> <textFieldExpression><![CDATA[($F{contactCity}==null ? "" : $F{contactCity}) + ", " + ($F{contactState}==null ? "" : $F{contactState}) + " " + ($F{contactZipCode}==null ? "" : $F{contactZipCode})]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement uuid="3be90961-7d34-443c-ac97-53f2f45da889" positionType="Float" x="0" y="19" width="100" height="0"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement/> <textFieldExpression><![CDATA[$F{contactPhoneNumber} + ($F{contactFax} != null && $F{contactFax}.compareTo("") != 0 ? "\n" + $F{contactFax} : "") + ($F{contactEmailAddress} != null && $F{contactEmailAddress}.compareTo("") != 0 ? "\n" + $F{contactEmailAddress} : "")]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement uuid="3ee3a448-32dd-47d4-a32e-c82ad9d7c562" positionType="Float" x="0" y="15" width="100" height="0"/> <textElement/> <textFieldExpression><![CDATA[$F{contactFirstName} + " " + $F{contactLastName}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="01991e9a-95b6-4653-b326-3c31f03d7044" x="199" y="16" width="180" height="15"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[($F{clientCode} == null ? "" : $F{clientCode})]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="be71e01f-d410-4234-ae39-5874f7b8ec78" x="199" y="31" width="180" height="15"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[$F{clientAddress} + ($F{clientAddress2} != null && $F{clientAddress2}.compareTo("") != 0 ? "\n" + $F{clientAddress2} : "")]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="44285da9-723b-480f-8bbc-33f2b2d9cfac" x="199" y="46" width="180" height="15"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[($F{clientCity}==null ? "" : $F{clientCity}) + ", " + ($F{clientState}==null ? "" : $F{clientState}) + " " + ($F{clientZipCode}==null ? "" : $F{clientZipCode})]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="630790c2-d522-4e67-9393-00a39ab7e69b" x="199" y="2" width="180" height="15"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[$F{clientName} == null ? "" : $F{clientName}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="2a2e4fb7-467b-47f2-97f0-20b26a9e1908" x="199" y="61" width="180" height="15"/> <textElement textAlignment="Center"/> <textFieldExpression><![CDATA[$F{clientServicePerson} == null ? "" : $F{clientServicePerson}]]></textFieldExpression> </textField> <textField isBlankWhenNull="true"> <reportElement uuid="7e95cf5c-c027-4f17-bc73-e445b50013d2" x="302" y="76" width="20" height="15"/> <textElement/> <textFieldExpression><![CDATA[$F{clientNumBooks}]]></textFieldExpression> </textField> <staticText> <reportElement uuid="0171e5a2-928e-47fd-982d-76126f0bbc0a" x="258" y="76" width="44" height="15" forecolor="#3399FF"/> <textElement/> <text><![CDATA[#Books:]]></text> </staticText> <line> <reportElement uuid="871dcc80-7952-46ce-adb1-b986d6d1cf29" positionType="Float" x="236" y="91" width="92" height="1"/> </line> </band> </pageHeader> <detail> <band height="365" splitType="Prevent"> <subreport> <reportElement uuid="4a6572e5-4628-445f-a8e2-234e96737522" isPrintRepeatedValues="false" x="88" y="0" width="413" height="0"/> <dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{clientList})]]></dataSourceExpression> <subreportExpression><![CDATA[$P{SUBREPORT_DIR} + "ClientReportsSummary_subreport1.jasper"]]></subreportExpression> </subreport> <staticText> <reportElement uuid="5f9e3e69-12f4-4abf-9294-6325873973f3" positionType="Float" x="111" y="14" width="100" height="15" forecolor="#3399FF"/> <textElement/> <text><![CDATA[special Notes:]]></text> </staticText> <textField isStretchWithOverflow="true" isBlankWhenNull="true"> <reportElement uuid="94a84333-c8ae-4ca1-a532-19198fb3f2b1" positionType="Float" x="111" y="29" width="355" height="119"/> <box> <topPen lineWidth="0.5" lineStyle="Solid"/> <leftPen lineWidth="0.5" lineStyle="Solid"/> <bottomPen lineWidth="0.5" lineStyle="Solid"/> <rightPen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement/> <textFieldExpression><![CDATA[$F{specialNotes}]]></textFieldExpression> </textField> </band> </detail></jasperReport> Link to comment Share on other sites More sharing options...
ahallez Posted March 15, 2014 Share Posted March 15, 2014 Anybody who knows how to solve this problem, I'm in a similar situation.Many thanks,Axel Link to comment Share on other sites More sharing options...
sarjuanca Posted July 25, 2014 Share Posted July 25, 2014 hi Ahallez, i have the same trouble, there is some answer? 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