Change memoview text

pinbotpinbot Texas
edited 5:20PM in FastReport 2.xx VCL
I think this should be easy but not working.

I'm not a pascal expert so could definately be my problem.

I'm trying to change the text of a TfrMemoView which normally displays the value of a data field. If the value is 0, I'd like to print "N/A"

I tried this
if [SOPDataSet."Occupancy"] =0 then
begin
FillColor := clRed;
Memo.Clear;
Memo.Add := '' + 'N/A' + '';
end

The background changes to red okay but the text is always blank.

TIA,
Bryan.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 5:20PM
    Just like a delphi memo
    the memo's text is an indexed stringlist of lines.
    memo1.memo.lines.clear
    also watch the nuber of apostrophes used don't forget just like delphi
    they get stripped.
    You want to be carefull subbing Strings like 'N/A' , if the memo is not set to text only it will try to divide N by A and you will get errors.
    regards ;)

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.