Friday, 15 June 2012

string - Crystal Reports: Formula unable to make 0.00 value appear blank -



string - Crystal Reports: Formula unable to make 0.00 value appear blank -

i have summarized our inventory usage per financial year quarter. null values appear 0.00, want create them blank. formula have worked out far this:

if isnull({usage.curfy_q1}) , isnull({usage.curfy_q2}) , isnull({usage.curfy_q3}) , isnull({usage.curfy_q4}) "" else "q1: " & cstr({usage.curfy_q1}) & chr(13) & chr(10) & "q2: " & cstr({usage.curfy_q2}) & chr(13) & chr(10) & "q3: " & cstr({usage.curfy_q3}) & chr(13) & chr(10) & "q4: " & cstr({usage.curfy_q4})

the formula creates result:

q1: 5.00 q2: 2.00 q3: 0.00 q4: 0.00

i prefer:

q1: 5 q2: 2 q3: q4:

i think totext(q1,0) may involved... :)

local stringvar q1; local stringvar q2; local stringvar q3; local stringvar q4; if isnull({usage.curfy_q1}) q1:="" else q1:=totext({usage.curfy_q1},0); if isnull({usage.curfy_q2}) q2:="" else q2:=totext({usage.curfy_q2},0); if isnull({usage.curfy_q3}) q3:="" else q3:=totext({usage.curfy_q3},0); if isnull({usage.curfy_q4}) q4:="" else q4:=totext({usage.curfy_q4},0); if (q1="" , q2="" , q3="" , q4="") "" else "q1: " & q1 & chr(10) & "q2: " & q2 & chr(10) & "q3: " & q3 & chr(10) & "q4: " & q4

string crystal-reports formula inventory-management

No comments:

Post a Comment