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 8016299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T20:30:05+00:00 2026-06-04T20:30:05+00:00

I have a table in iReport with 3 fields (A, B, C). I would

  • 0

I have a table in iReport with 3 fields (A, B, C). I would to print the row iff field C is not null. For example if I have 2 records in my data source:

  1. A = first, B = second, C = third

  2. A = up, B = down, C = NULL

the table must have only the first row.

I have tried inserting this expression in each cell (in “Print when expression” property):

!$F{C}.equals(null)

but in this way the result is that the second row is empty (but visible).

Edit: after the first answer (now erased) the columns in the table are something like:

<jr:column ...>
<jr:columnHeader ...>
   <staticText>
    <reportElement .../>
        <text><![CDATA[ID]]></text>
   </staticText>
</jr:columnHeader>
<jr:detailCell ...>
   <textField isBlankWhenNull="false">
    <reportElement ... isRemoveLineWhenBlank="true">
        <printWhenExpression><![CDATA[$F{ID}!=null]]></printWhenExpression>
    </reportElement>
        <textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
   </textField>
</jr:detailCell>
</jr:column>
<jr:column ...>
<jr:columnHeader ...>
    <staticText>
        <reportElement .../>
        <text><![CDATA[CITY]]></text>
    </staticText>
</jr:columnHeader>
<jr:detailCell ...>
    <textField isBlankWhenNull="false">
        <reportElement ... isRemoveLineWhenBlank="true">
            <printWhenExpression><![CDATA[$F{ID}!=null]]></printWhenExpression>
        </reportElement>
        <textFieldExpression><![CDATA[$F{CITY}]]></textFieldExpression>
    </textField>
</jr:detailCell>
</jr:column>

The data source is a xml file. I’ve tried also with isBlankWhenNull="true" but with no change. Here a screen of the result:
tab

  • 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-04T20:30:06+00:00Added an answer on June 4, 2026 at 8:30 pm

    When you put the print when expression on the field, only the field will be removed. Hence, the space will remain. Put the same expression on the detail band and try again.

    Edit:

    Looking at the problem further, I’ve noticed there is no option to omit records (Print When Expression) at the detail level of the table element. That option doesn’t exist as you can see in iReport and also in the schema definition. Furthermore, the reason isBlankWhenNull="true" isn’t working is because, even though the textfield is empty, the detail row still takes up the allocated height. Also, the PrintWhenExpression you tried to modify applies to the whole table and not the row. So it doesn’t seem like it is possible to do the way you were hoping.

    Here I will give you these steps to solve your problem:

    1. Update the XPath query to your dataset run property (right click > edit table datasource from table designer view) so that the records where C is null are omitted.
    2. Choose your sub dataset and select “Use datasource expression” from Connection / Datasource expression menu.
    3. Insert the following expression:

    ((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/root[c!='']")

    Good Luck.

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

Sidebar

Related Questions

I have table with statistical data. I'm trying to count the records grouped by
I have table with two SelectOneMenu in row. I need populate data in second
I have table named A with column B defined int not null Primary Key
i have table and i tried to add `id` int(11) NOT NULL auto_increment, to
I have table with several fields, one of them is Id auto-increment/primary field. Is
I have table Owner in my database where one of the field (System) saved
I have table of products, and there are 2 fields: price, currency. Possible values
I have table like this: +------+-------+ | user | data | +------+-------+ | 1
I have table with Persian data and utf8_general_ci collection and with php program i
I have table in my database which has fields of ID,NAME,CONTEXT. I am showing

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.