How do I handle empty number fields/variables in Crystal Reports?

青春壹個敷衍的年華 提交于 2019-12-25 03:26:08

问题


I have the following formula in my group footer, but am having problems with displaying 0 if sample_perc is empty; this value gets empty if #rt_sample_ordered is blank.

NumberVar sample_perc := {#rt_sample_ordered}%{@sum_of_sample};
if (sample_perc>0)then
   sample_perc
else
  0

How do i print 0 when sample_perc is blank?


回答1:


If Isnull({#rt_sample_ordered}) Or Isnull({@sum_of_sample}) Then
  0
Else If ( {#rt_sample_ordered}%{@sum_of_sample} ) > 0 Then
  sample_perc
Else
  0


来源:https://stackoverflow.com/questions/11405759/how-do-i-handle-empty-number-fields-variables-in-crystal-reports

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