如何在快速报表4中为列总计设置值
how to set value for the column grand total in fast report 4
我有一个数据库交叉表对象enter image description here
我想为示例的列总计设置值:
A+B-C-D-E-F-G-H-I = 总计
或
总计 = 总计 -A -B
尝试使用 cross' 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;
我有一个数据库交叉表对象enter image description here
我想为示例的列总计设置值: A+B-C-D-E-F-G-H-I = 总计
或 总计 = 总计 -A -B
尝试使用 cross' 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;