Yes, it's possible. Calculate in the TfrxCrossView.OnPrintCell event, print custom total in the TfrxCrossView.OnPrintCell event. Use TfrxCrossView.IsGrandTotalRow to determine grand total row
I think I have a complex problem and it looks like it can only be solved with complex code.
But, can you tell me if there is an easy way? See attachment.
The Percent Row is Term/Active and is already calculated per row. Calculating the grand line total is not hard, but the hard part is the subtotals because it seems I need to have an array to remember the column amounts.
Is there is an easy way to do this or is this a hard problem?
The solution turned out to be simple due to the sequence that Fast Reports processes data. I did not have to worry about if the data was in a Total or Grand Total, the following code works anyways. I just don't like hard coding the cell Index and relying on process order, but oh well it works.
const
  MaxPeriods = 100;
   Â
var
  PeriodActive: array[0..MaxPeriods] of Integer;
  PeriodTerm: array[0..MaxPeriods] of Integer;
     Â
 Â
procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
var
  PercentTerm: Single;                                                 Â
begin
  if CellIndex = 0 then
    PeriodActive[ColumnIndex]:= Value
  else if CellIndex = 1 then
    PeriodTerm[ColumnIndex]:= Value
  else if CellIndex = 2 then
  begin
    if PeriodActive[ColumnIndex] = 0 then
      PercentTerm:= 0
    else
      PercentTerm:= (PeriodTerm[ColumnIndex] / PeriodActive[ColumnIndex]) * 100;                                                                                                                   Â
    Memo.Text:= Format('%2.2f%%', [PercentTerm]);
  end;             Â
end;
procedure Page1OnBeforePrint(Sender: TfrxComponent);
var
  I: Integer;                                 Â
begin
  for I:= 0 to MaxPeriods do
  begin             Â
    PeriodActive[I]:= 0;                                                     Â
    PeriodTerm[I]:= 0;
  end;                 Â
end;
begin
end.
Comments
But, can you tell me if there is an easy way? See attachment.
The Percent Row is Term/Active and is already calculated per row. Calculating the grand line total is not hard, but the hard part is the subtotals because it seems I need to have an array to remember the column amounts.
Is there is an easy way to do this or is this a hard problem?
I think no other way, but array usage not a hard problem
Sorry I was interrupted at work and quickly sent this message without adding the attachment. Attachment is added to this message.