问题
I have crosstab looks like this
Jan Feb
Emp1 500 600
Emp2 600 700
Emp3 0 0
I want to hide the row3 as it has zero values. I have seen in crosstab expret to supress empty rows but that doesn't server the purpose. I want output like this
Jan Feb
Emp1 500 600
Emp2 600 700
回答1:
Create a SQL Expression that returns a NULL:
-- {@DB_NULL}
-- Oracle syntax
(
SELECT NULL FROM DUAL
)
-- {@DB_NULL}
-- MS SQL syntax
(
SELECT NULL
)
Create a formula field to convert 0 to NULL:
-- {@data}
If {table.field}=0 Then
{@DB_NULL}
Else
{table.field}
Reference this field in your cross-tab instead of {table.field}
. You may have to reset the 'suppress empty rows' setting.
来源:https://stackoverflow.com/questions/15128786/supress-zero-rows-in-crosstab-crystal-reports