How to access row and columnvalues in a TfrxDBCrossView

edited April 2010 in FastReport 4.0
my intention is to have the "grand total" column containing two Memos instead of only one.
the column should not only contain the summed total but also another value calculated from the cellvalues of the current row.
i did not succed in implementing a second memo into the "grand total" column instead i created a new TfrxMemoViews beside each cell of the "Grand Total" column.

the main problem now is that i want my new memo to contain a value calculated from the previosly printed cells in the corresponding row.

the ColumnIndex of my "Grand Total" Column is 3 i can acces the rowvalues[0] but trying to access rowvalues[1] results in an index out of range exception
i would like set the value of the new collumn is the example below as follows:

text := rowvalues[ColumnIndex - 1] - rowValues[ColumnIndex - 2];

procedure DBCrossUmsatzOnPrintCell(AMemo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant); 
begin    
  if DBCrossUmsatz.IsGrandTotalColumn(ColumnIndex) = true then
                                          
    with TfrxMemoView.Create(AMemo.Owner) do begin
        left :=  AMemo.Left + AMemo.Width;
//        text := IntToStr(RowIndex) + ' - ' + IntToStr(ColumnIndex) + ' - ' + IntToStr(CellIndex);                                                        
        text := rowvalues[ColumnIndex - 1] - rowValues[ColumnIndex - 2];
        parent :=  AMemo.Parent;
        Width :=  AMemo.Width;
        Height :=  AMemo.Height;
        Top :=  AMemo.Top;
        Frame.Typ := 15;                                          
     end;                                   
end;

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.