supress zero rows in crosstab crystal reports

烂漫一生 提交于 2020-01-16 21:51:16

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!