Avoid new line in frxMemoView

edited 8:25AM in FastReport VCL 5
I need help with the following problem:
My program prints a kind of diploma.
In a memoView several lines of text are printed (streched).
To keep the printed diploma from beeing changed by adding text manually, the last line has to end with '----'.
How can i avoid the case, where appending '----' to the text, results in a new line?
(which meens that the last line is already filled with text and no '----' must be added)

I tried this:

procedure MemoSperrenOnAfterData(Sender: TfrxComponent);
var count: integer;
begin
count := tFrxMemoView(sender).lines.count;
if count > 1 then
if tFrxMemoView(sender).lines.strings[count - 1] = '----' then
TfrxMemoView(Sender).Memo.Delete(count - 1);
end;

begin

end.

But it does not work. Maybe the text is not jet wrapped when OnAfterData is triggered!?



I use Delphi xe5 and fast report vcl 5.1

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:25AM
    Your problem is probably here
    "if tFrxMemoView(sender).lines.strings[count - 1] = '----' then"
    wrapping has occured, but you may not have 4 '-' characters
    depending on the length of the previous line and the width of the memo and rhe font size

Leave a Comment