Filling Empty Cells

Hi,

I have a report that uses a TfrxDBCrossView. Depending on the datas that I choose to open, my SQL returns empty values. So that is how my report is looking like right now:

| Item1 | Item2 | Item3 | Item4 |
date1 | Value | Value | Value | |
date2 | Value | | Value | Value |
date3 | Value | Value | | Value |


But, this is how I want it to be like:

| Item1 | Item2 | Item3 | Item4 |
date1 | Value | Value | Value | NULL |
date2 | Value | NULL | Value | Value |
date3 | Value | Value | NULL | Value |


So I tried many different things at the OnPrintCell Event but I got no results, this is an example of one of my tries:


procedure DBCross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
begin
if (qryReport.FieldByName('valor').Value = NULL) then
begin
Memo.Text := 'NULL';
end;
end;

where qryReport is my TfrxDBXQuery and valor is the field I want it to read the value.

Does anybody have any idea of how I'm going to make that work????

Thanks for any help extended!!

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 3:52AM
    work with the memo's text property
    procedure Cross1OnPrintCell(Memo: TfrxMemoView; RowIndex, ColumnIndex, CellIndex: Integer; RowValues, ColumnValues, Value: Variant);
    begin
    if memo.text = '' then memo.text :='null';
    end;
    ;)

Leave a Comment