DbCrossView change title dynamically

edited 2:13PM 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 2:13PM
    Try
    TfrxCrossView(frxReport1.FindObject('DBCross1')).CornerMemos[1].Text := 'Items';
    TfrxCrossView(frxReport1.FindObject('DBCross1')).CornerMemos[3].Text := 'Ingredients';
  • edited 2:13PM
    Thank you very much, it works!
  • edited 2:13PM
    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 2:13PM
    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 2:13PM
    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
  • edited 2:13PM
    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 2:13PM
    Try
    procedure Page1OnBeforePrint(Sender: TfrxComponent);
    begin
        Cross1Corner0.Text := '12345';  
    end;
    
  • edited 2:13PM
    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

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.