cancel
Showing results for 
Search instead for 
Did you mean: 

Display NULL values in iGrids as space?

Former Member
0 Kudos

Is there any way to tell the iGrid, that it should show columns containing DB NULL simply blank (e.g. one SPACE or anything else which is unvisible)? Actually NULL values are shown as "NA" for numbers resp. "---" for strings, which is rather annoying.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Bodo,

Use this code to replace NULL values like "NA" or "---" with SPACE -

for (i=0; i<=objGrid.getGridObject().getRowCount(); i++)

{

for (j=0; j<=objGrid.getGridObject().getColumnCount(); j++)

{

if (objGrid.getGridObject().getCellValue(i, j) == "" ||

objGrid.getGridObject().getCellValue(i, j) == "---" ||

objGrid.getGridObject().getCellValue(i, j) == "NA")

{

objGrid.getGridObject().setCellValue(i, j, " ");

}

}

}

Another way is if you are using a stylesheet then you can modify the stylesheet to handle NULL.

Regards,

Anil

jcgood25
Active Contributor
0 Kudos

The handling of nulls different than blanks is expected behavior, so I wouldn't get overly 'annoyed' by it.

What is the source of your query template - SQL? If so then I recommend the CASE statement where you can turn your null values into blanks.

Former Member
0 Kudos

Hi Jeremy,

thanks for your answer. Actually I will omit the NV-Strings directly within our SQL-Command using the ORACLE NVL Command. Since we generally use FixedQueries, this should not be a problem.

Bodo

Former Member
0 Kudos

That's the place to handle it - in the query - and if your Query language can handle it with a built in function, even better. Sure, the JS approach will work, but that's some overhead and it's always best to handle data at its source anyway.

Former Member
0 Kudos

Nevertheless I think, it would be a good idea, to implement a new property into the iGrid component, which switches the visibility behaviour of Null Values.

Bodo.