CreateUniqueName

edited 1:01AM in FastReport 4.0
var
                                                                          
 Memo: TfrxMemoView;
                                                   
Procedure frxReport1OnStartReport(Sender: TfrxComponent);
var i:integer;                             
begin
                
  For i:=11 to  MasterData2.dataset.FieldsCount -1 do
    begin
     Memo := TfrxMemoView.Create(Header2);
     Memo.CreateUniqueName;
     Memo.Text := 'Hello FastReport!';
                   
    end;  
end;


I have a problem when I try to create Memo on Header2 band.
I get a message : Undeclared identifier CreateUniqueName
Why ?

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 1:01AM
    first, the memo view must be created in the context of it's owner
    since you haven't created a variable of the band type and pointed it to the band, you have not created the memo
    and therefore cannot access its properties.

    second where are you trying to do this inside the report script or at the delphi level?

  • edited February 2009
    var
     head : TfrxHeader;                                          
     Memo: TfrxMemoView;
                                                 
            
       
    procedure frxReport1OnStartReport(Sender: TfrxComponent);
    var i:integer;                             
    begin
        head := Header1;                                   
            
      For i:=11 to  MasterData1.dataset.FieldsCount -1 do
        begin
         Memo := TfrxMemoView.Create(head);
         Memo.CreateUniqueName;
         Memo.Text := 'Hello FastReport!';
                                 
        end;  
    end;
    

    OK, now I have code like this.
    I added "head" variable, but CreateUniqueName is unknown again.
    I just want add few memos on header and Masterdata.
    I try to do this inside the report script.
    Can anyone help me ?
  • gordkgordk St.Catherines On. Canada.
    edited 1:01AM
    that is not a valid call inside the report., it is used when creating a report from code at the delphi level.

Leave a Comment