【问题标题】:chenge value from string to number in fast report在fastreport中将值从字符串更改为数字
【发布时间】:2016-03-26 11:38:28
【问题描述】:

我在快速报告的数据库交叉表中有一个脚本,我想显示从字符串到数字(%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;

【问题讨论】:

    标签: format crosstab fastreport


    【解决方案1】:
    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')))]);
    

    结束;

    【讨论】:

    • 尊敬的 gpi 嗨,非常非常 tnx 询问我的问题
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-17
    • 1970-01-01
    相关资源
    最近更新 更多