Memo.highlight fontname not changeing on runtime!

Hello I try change hightlight properties form delphi source:

procedure TForm96.frxReport1BeforePrint(Sender: TfrxReportComponent);
var
oMemo: TfrxMemoView;
begin
If Pos( 'MEMO',UpCase( Form96.frxReport1.CurObject ) ) <> 0 Then Begin
oMemo := TfrxMemoView( Form96.frxReport1.FindObject( Form96.frxReport1.CurObject ) );
oMemo.Highlight.Font.Name := Form3.aSystem[33]; <<<not work
oMemo.Highlight.Color := clRed; <<<not work
oMemo.Font.Name := Form3.aSystem[33]; <<<this work
End;
end;

why not happend? any ideas?
thanks.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 8:23AM
    this event fires for every object in the report
    procedure TForm96.frxReport1BeforePrint(Sender: TfrxReportComponent);

    the typical syntax would be
    begin
    if sender.name = 'Memo1' then
    with tfrxmemoview(sender) do // cast sender
    begin
    set props here
    end;
    end;

    if you turn on auto code completion
    you will find all the props available and their required types when you pause after a dot.
    ;)
  • gordkgordk St.Catherines On. Canada.
    edited 8:23AM
    Ishould have said
    this event fires for every object in the report so you are better to doit where
    you load the report.
    sample
    procedure TForm1.Button7Click(Sender: TObject);
    var

    LFXMCOM:TfrxMemoView;

    begin
    frxReport4.Clear;
    frxreport4.LoadFromFile('testHighlight.fr3');
    lfxmcom := frxreport4.FindObject('Memo1') as tfrxmemoview;
    lfxmcom.Highlight.Condition := '<Line> mod 2';
    lfxmcom.Highlight.Font.Name := 'Arial Black';
    lfxmcom.Highlight.Font.Style := [fsBold];
    frxreport4.ShowReport;
    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.