如何在快速报告4中设置列总计的值

时间:2016-03-11 23:19:18

标签: fastreport

我有一个数据库交叉表对象enter image description here

enter image description here

我为exampel的列总计设定值: A + B-C-D-E-F-G-H-I = Grand ToTal

或 总计=总计-A -B

1 个答案:

答案 0 :(得分:0)

尝试使用交叉'OnPrintCell事件(总计=总计 - A):

procedure Cross1OnPrintCell(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 Cross1.IsGrandTotalColumn(ColumnIndex) then Memo.Text := VarToStr(Value - Get('Var0'));
end;