Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7776665
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T17:56:28+00:00 2026-06-01T17:56:28+00:00

I have created three text field in Header. I have put parameter in all

  • 0

I have created three text field in Header. I have put parameter in all textField elements. When I’m not calling one of three parameter of three textField elements. It will show 2 textField elements. The problem now is there are space between the text fields.

How to remove the space?

This is my code:

<textField isBlankWhenNull="true">
    <reportElement x="0" y="18" width="555" height="35" isRemoveLineWhenBlank="true"/>
    <textElement textAlignment="Center">
        <font size="12"/>
    </textElement>
    <textFieldExpression><![CDATA[$P{daterangefrom}  && $P{daterangeto}  ?  "From ( " + $P{daterangefrom} + " - " + $P{daterangeto} + ")"
: $P{weeks}  && $P{monthy} && $P{yrs} ? "For week " + $P{weeks} +" "+ $P{monthy} +" "+ $P{yrs}
: $P{monthy}  && $P{yrs} ? "For monthly " +$P{monthy} +" "+ $P{yrs}
: $P{quarter}  &&  $P{yrs}  ? "For Quarter " + $P{quarter} +" "+$P{yrs}
: $P{yrs}  ? "For " + $P{yrs}
: null]]>
    </textFieldExpression>
</textField>

This is mine result:

enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T17:56:29+00:00Added an answer on June 1, 2026 at 5:56 pm

    You can use 3 textField elements with isRemoveLineWhenBlank property set to true value.

    The sample (jrxml file):

    <?xml version="1.0" encoding="UTF-8"?>
    <jasperReport .. topMargin="0" bottomMargin="0">
        <parameter name="parameter1" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <parameter name="parameter2" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <parameter name="parameter3" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <title>
            <band height="102" splitType="Stretch">
                <textField isBlankWhenNull="true">
                    <reportElement x="163" y="9" width="100" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{parameter1} == null ? null : "Parameter1: " + $P{parameter1}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="163" y="29" width="100" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{parameter2} == null ? null : "Parameter2: " + $P{parameter2}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="163" y="49" width="100" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{parameter3} == null ? null : "Parameter3: " + $P{parameter3}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="163" y="73" width="100" height="20"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <text><![CDATA[Static text]]></text>
                </staticText>
                <line>
                    <reportElement x="63" y="6" width="447" height="1"/>
                </line>
                <line>
                    <reportElement x="73" y="96" width="447" height="1"/>
                </line>
            </band>
        </title>
    </jasperReport>
    

    The report design in iReport:
    Report's design in iReport

    For the parameter1=null, parameter2=null, parameter1=value3 the result will be:
    The result in iReport (preview mode)

    UPDATE

    For solving the problem of moving up the textField in case the element above was hide you can use the Frame container. You should add 2 frames (one per column) and put 2 textField elements (2 rows) in each frame.

    The sample (jrxml file):

    <?xml version="1.0" encoding="UTF-8"?>
    <jasperReport .. topMargin="0" bottomMargin="0">
        <parameter name="par1" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <parameter name="par2" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <parameter name="par3" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <parameter name="par4" class="java.lang.String">
            <defaultValueExpression><![CDATA[null]]></defaultValueExpression>
        </parameter>
        <title>
            <band height="80" splitType="Stretch">
                <line>
                    <reportElement x="10" y="6" width="520" height="1"/>
                </line>
                <line>
                    <reportElement x="10" y="72" width="520" height="1"/>
                </line>
                <frame>
                    <reportElement x="329" y="10" width="172" height="59"/>
                    <frame>
                        <reportElement x="13" y="3" width="60" height="54"/>
                        <textField isBlankWhenNull="true">
                            <reportElement x="1" y="20" width="52" height="20" isRemoveLineWhenBlank="true"/>
                            <box>
                                <topPen lineWidth="1.0"/>
                                <leftPen lineWidth="1.0"/>
                                <bottomPen lineWidth="1.0"/>
                                <rightPen lineWidth="1.0"/>
                            </box>
                            <textElement/>
                            <textFieldExpression><![CDATA[$P{par3} == null ? null : "P3: " + $P{par3}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                            <reportElement x="1" y="0" width="52" height="20" isRemoveLineWhenBlank="true"/>
                            <box>
                                <topPen lineWidth="1.0"/>
                                <leftPen lineWidth="1.0"/>
                                <bottomPen lineWidth="1.0"/>
                                <rightPen lineWidth="1.0"/>
                            </box>
                            <textElement/>
                            <textFieldExpression><![CDATA[$P{par1} == null ? null : "P1: " + $P{par1}]]></textFieldExpression>
                        </textField>
                    </frame>
                    <frame>
                        <reportElement x="73" y="3" width="70" height="54"/>
                        <textField isBlankWhenNull="true">
                            <reportElement x="1" y="0" width="52" height="20" isRemoveLineWhenBlank="true"/>
                            <box>
                                <topPen lineWidth="1.0"/>
                                <leftPen lineWidth="1.0"/>
                                <bottomPen lineWidth="1.0"/>
                                <rightPen lineWidth="1.0"/>
                            </box>
                            <textElement/>
                            <textFieldExpression><![CDATA[$P{par2} == null ? null : "P2: " + $P{par2}]]></textFieldExpression>
                        </textField>
                        <textField isBlankWhenNull="true">
                            <reportElement x="1" y="20" width="52" height="20" isRemoveLineWhenBlank="true"/>
                            <box>
                                <topPen lineWidth="1.0"/>
                                <leftPen lineWidth="1.0"/>
                                <bottomPen lineWidth="1.0"/>
                                <rightPen lineWidth="1.0"/>
                            </box>
                            <textElement/>
                            <textFieldExpression><![CDATA[$P{par4} == null ? null : "P4: " + $P{par4}]]></textFieldExpression>
                        </textField>
                    </frame>
                </frame>
                <textField isBlankWhenNull="true">
                    <reportElement x="10" y="30" width="52" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{par3} == null ? null : "P3: " + $P{par3}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="10" y="10" width="52" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{par1} == null ? null : "P1: " + $P{par1}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="64" y="10" width="52" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{par2} == null ? null : "P2: " + $P{par2}]]></textFieldExpression>
                </textField>
                <textField isBlankWhenNull="true">
                    <reportElement x="64" y="30" width="52" height="20" isRemoveLineWhenBlank="true"/>
                    <box>
                        <topPen lineWidth="1.0"/>
                        <leftPen lineWidth="1.0"/>
                        <bottomPen lineWidth="1.0"/>
                        <rightPen lineWidth="1.0"/>
                    </box>
                    <textElement/>
                    <textFieldExpression><![CDATA[$P{par4} == null ? null : "P4: " + $P{par4}]]></textFieldExpression>
                </textField>
            </band>
        </title>
    </jasperReport>
    

    The report design in iReport:
    The design in iReport. Two cases

    For the par1=null, par2=2, par3=3, par4=4 the result will be:
    The result in iReport preview. Two cases

    You can compare the results – left side is done without using frame and the right side with frame elements.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am new to iPad developer, i have created two or three iPad application
I have created a UserForm where the user is required to fill-in three fields.
I have a convenience class for encoding URI's. In it I've created three methods
I have three unordered lists that have been created as Scriptaculous Sortables so that
I have been learning C++ for three months now and in that time created
I have a Pocket PC 2003 solution, consisting of three projects, that was created
I have several NSComboBoxes created in Interface Builder, and one created programmatically. The NSComboBoxes
I am using MySQL data base with Rails. I have created a field of
I have created a highlight feature that will highlight anything contained in a <p>
I have an INPUT text field, a DIV and an IMG. The IMG has

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.