我有以下公式命名@newitemQuant
:
WhileReadingRecords;
StringVar text := Totext ( {AR_SalesBySalesPersonDenim;1.quantity} , 6 , "" ) ;
NumberVar end := length ( text ) ;
NumberVar clip :=
(if Val ( text [ end - 6 to end ] ) = 0 then 1 else 0 ) +
(if Val ( text [ end - 5 to end ] ) = 0 then 1 else 0 ) +
(if Val ( text [ end - 4 to end ] ) = 0 then 1 else 0 ) +
(if Val ( text [ end - 3 to end ] ) = 0 then 1 else 0 ) +
(if Val ( text [ end - 2 to end ] ) = 0 then 1 else 0 ) +
(if Val ( text [ end - 1 to end ] ) = 0 then 1 else 0 ) +
(if Val ( text [ end - 0 to end ] ) = 0 then 1 else 0 ) ;
text [ 1 to Length ( text ) - clip ]
这基本上将我{AR_SalesBySalesPersonDenim;1.quantity}
的具有 NUMBER 数据类型的数据库字段转换为 STRING,然后再对其进行操作。并在报告中显示生成的 STRING。
现在我想在报告中放置一个结果字符串字段的摘要。无法做到这一点。
我尝试ToNumber()
在同一个公式和一个新公式中使用:
numbervar fVal;
fVal := ToNumber({@newitemQuant}).
但没有进展。提前致谢