快速报告中从字符串到数字的值

时间:2016-03-25 20:04:18

标签: format crosstab fastreport

我在快速报告中的数据库交叉表中有一个脚本,我从字符串到数字(%2.0n)和分隔符,

显示值格式
procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin
if ColumnIndex = 0 then
if Value <> null then 
  Set('Var0', Value)
else
  Set('Var0', 0);
  if DBCross1.IsGrandTotalColumn(ColumnIndex) then 
Memo.Text :=VarToStr(value- Get('Var0'));
end;

1 个答案:

答案 0 :(得分:0)

procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin
  if ColumnIndex = 0 then
    if Value <> null then 
      Set('Var0', Value)
    else
      Set('Var0', 0);
    if DBCross1.IsGrandTotalColumn(ColumnIndex) then 
       Memo.Text := Format('%2.0n', [StrToFloat(VarToStr(value- Get('Var0')))]);

端;