DbCrossView change title dynamically

edited 9:27AM in FastReport 4.0
Hello,

I need to create DbCrossView on the fly.

I can do everything except to change the titles -> I haven't found properties for that.
In design mode I noticed that it creates "DBCross1Corner1" and "DBCross1Corner3" memos, so I tried to change by code, but I couldn't find them:

Memo := frxReport.FindObject('DBCross1Corner1') as TfrxMemoView;
if Memo<>nil then
Memo.Text := 'Items';

Memo := frxReport.FindObject('DBCross1Corner3') as TfrxMemoView;
if Memo<>nil then
Memo.Text := 'Ingredients';

I also examined the report as xml in an editor -> I didn't find any clue there either.

Comments

  • gpigpi
    edited 9:27AM
    Try
    TfrxCrossView(frxReport1.FindObject('DBCross1')).CornerMemos[1].Text := 'Items';
    TfrxCrossView(frxReport1.FindObject('DBCross1')).CornerMemos[3].Text := 'Ingredients';
  • edited 9:27AM
    Thank you very much, it works!
  • edited 9:27AM
    Gpi,

    Can you tell me what is the reason that I do not see the property DBCross1.CornerMemos in compiled FR 4 demo in Classes tab. I can locate it only in frxClass.pas. My compiled Designer doesn't have this property too. I use only FR script in my reports and what should be done to let my Designer see DBCross1.CornerMemos?

    Mick
  • gpigpi
    edited 9:27AM
    You can use Cross' OnBeforePrint event
    procedure Cross1OnBeforePrint(Sender: TfrxComponent);
    begin
        Cross1Corner3.Text:='123456';                                  
    end;
    
    Not all Delphi's properties was added in FS
  • edited 9:27AM
    Thanks Gpi [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> OnBeforePrint event is fired but[/img]Cross1Corner3.Text:='123456'; has no result.
    I'll get new Designer compiled with more Delphi properties.

    Mick
  • gpigpi
    edited April 2011
    Mick.pl
    See a report template for FRDemo in attach
    63.fr3 13.5K
  • edited 9:27AM
    Thanks Gpi,

    Ok, this work fine with one of titles.
    The second seems to be not available from within FR script >
    procedure Cross1OnBeforePrint(Sender: TfrxComponent);
    begin
       Cross1Corner3.Text := '12345';     // works fine
       [b]Cross1Corner0.Text := 'abcde';[/b]   // no result
    end;
    
    Mick
  • gpigpi
    edited 9:27AM
    Try
    procedure Page1OnBeforePrint(Sender: TfrxComponent);
    begin
        Cross1Corner0.Text := '12345';  
    end;
    
  • edited 9:27AM
    Thanks Gpi [img]style_emoticons/<#EMO_DIR#>/smile.gif" style="vertical-align:middle" emoid=":)" border="0" alt="smile.gif" /> Now it works fine - even if I fire OnBeforePrint event for the band where I put DBCrossView as well. It seems to be a bug in a FR as obp event for DBCrossView should have an access to all details of DBCrossView. Mick[/img]

Leave a Comment