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 5:24AM
    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

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.