Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to erase rows in a table if an expression is valid in iReport
    text
    copied!<p>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:</p> <ol> <li><p>A = first, B = second, C = third</p></li> <li><p>A = up, B = down, C = NULL</p></li> </ol> <p>the table must have only the first row.</p> <p>I have tried inserting this expression in each cell (in "Print when expression" property):</p> <pre><code>!$F{C}.equals(null) </code></pre> <p>but in this way the result is that the second row is empty (but visible).</p> <p>Edit: after the first answer (now erased) the columns in the table are something like:</p> <pre><code>&lt;jr:column ...&gt; &lt;jr:columnHeader ...&gt; &lt;staticText&gt; &lt;reportElement .../&gt; &lt;text&gt;&lt;![CDATA[ID]]&gt;&lt;/text&gt; &lt;/staticText&gt; &lt;/jr:columnHeader&gt; &lt;jr:detailCell ...&gt; &lt;textField isBlankWhenNull="false"&gt; &lt;reportElement ... isRemoveLineWhenBlank="true"&gt; &lt;printWhenExpression&gt;&lt;![CDATA[$F{ID}!=null]]&gt;&lt;/printWhenExpression&gt; &lt;/reportElement&gt; &lt;textFieldExpression&gt;&lt;![CDATA[$F{ID}]]&gt;&lt;/textFieldExpression&gt; &lt;/textField&gt; &lt;/jr:detailCell&gt; &lt;/jr:column&gt; &lt;jr:column ...&gt; &lt;jr:columnHeader ...&gt; &lt;staticText&gt; &lt;reportElement .../&gt; &lt;text&gt;&lt;![CDATA[CITY]]&gt;&lt;/text&gt; &lt;/staticText&gt; &lt;/jr:columnHeader&gt; &lt;jr:detailCell ...&gt; &lt;textField isBlankWhenNull="false"&gt; &lt;reportElement ... isRemoveLineWhenBlank="true"&gt; &lt;printWhenExpression&gt;&lt;![CDATA[$F{ID}!=null]]&gt;&lt;/printWhenExpression&gt; &lt;/reportElement&gt; &lt;textFieldExpression&gt;&lt;![CDATA[$F{CITY}]]&gt;&lt;/textFieldExpression&gt; &lt;/textField&gt; &lt;/jr:detailCell&gt; &lt;/jr:column&gt; </code></pre> <p>The data source is a xml file. I've tried also with <code>isBlankWhenNull="true"</code> but with no change. Here a screen of the result: <img src="https://i.stack.imgur.com/Mu8H1.png" alt="tab"></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload