[Logo] OLD FORUM - Use new one: https://www.CaptainCasa.online/forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
hide zero values in a gridcol  XML
Forum Index -> Development
Author Message
gseijo

Active

Joined: 29/09/2020 14:14:26
Messages: 21
Offline

hello björn,

for my planning...

In the fixgrid there is the function "showemptyrows" true/false, could I use it to hide all zeros in a column?

or is there an alternative?

I would like numerical values ​​to come in later, but as long as there is no data in the DB, "0" will definitely be displayed, right?

Greets
Gregorio

CaptainCasa

Power User
[Avatar]

Joined: 21/11/2007 12:23:06
Messages: 5555
Offline

Hi,

no, this SHOWEMPTYROWS refers to the availability of a whole grid item - independet from its content.

What you could do: use "Integer" (not "int") for your number (or "Double" instead of "double", etc.)

Let's assume your GridItem by default is implemented the following way:

Code:
 public class GridItem extends FIXGRIDItem
 {
     int i_value;
     public int getValue() { return i_value; }
 }
 


You could now change to:
Code:
 public class GridItem extends FIXGRIDItem
 {
     int i_value;
     public Integer getValue() 
     {
         if (i_value != 0)
             return i_value;
         else
             return null;
     }
 }
 


A null value will not be output in a FIELD/FORMATTEDFIELD/LABEL.

Kind regards! Björn

PS: when using LABEL for output, use LABEL-FORMAT and LABEL-FORMATMASK for proper output formatting. Otherwise the number will be teechnically convertged to a string, e.g. decimal numbe will always look like "1001.9" and not e.g. "1.001,90"...

Björn Müller, CaptainCasa GmbH
gseijo

Active

Joined: 29/09/2020 14:14:26
Messages: 21
Offline

Hello Björn,

wunderbar.

it workz
 
Forum Index -> Development
Go to:   
Powered by JForum 2.1.6 © JForum Team