【发布时间】:2011-12-07 03:07:33
【问题描述】:
我有一个名为@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}).
但没有进展。 提前致谢
【问题讨论】:
-
要对字符串字段进行什么汇总操作?
标签: string crystal-reports numbers summary