问题
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