error by frame.typ

var i,j:integer;
memofeld:array[1..5,1..5] of tfrxmemoview;
begin
for i:=1 to 5 do
for j:=1 to 5 do
begin
memofeld[i,j]:=tfrxmemoview.create(reporttitle1);
** memofeld[i,j].Frame.Typ:= [ftTop,ftBottom];** What's wrong here?
memofeld[i,j].setbounds(25*i,0,100,20);
memofeld[i,j].frame.color:=clblack;
memofeld[i,j].text:='test';
end;
end.

The Error is wrong Argument and I do not know why.

Comments

  • gordkgordk St.Catherines On. Canada.
    edited 2:16PM
    using 3.19.13
    you need a variable for the band
    Band: TfrxBand;
    it must point to the correct band not the band name
    the memos are then created within the context of the band
    reread the programmers manual on building reports from code objects should be created in a specific order.
    page,band, band objects, next band next band's objects etc..
    ;)
  • edited 2:16PM
    I have changed my program to:

    var i,j:integer;
    memofeld:array[1..5,1..5] of tfrxmemoview;
    band:tfrxband;
    Page: TfrxReportPage;
    begin

    Band := TfrxReportTitle.create(page);

    Band.Top := 0;
    Band.Height := 20;

    for i:=1 to 5 do
    for j:=1 to 5 do
    begin
    memofeld[i,j]:=tfrxmemoview.create(band);
    memofeld[i,j].Frame.Typ:= [ftTop,ftBottom];
    memofeld[i,j].setbounds(25*i,0,100,20);
    memofeld[i,j].frame.color:=clblack;
    memofeld[i,j].text:='test';
    end;
    end.

    But without success.
  • edited 2:16PM
    This is the example of the user-Document:
    var
    Band: TfrxReportTitle;
    Memo: TfrxMemoView;
    begin
    Band := TfrxReportTitle.Create(Page1);
    Band.Height := 20;
    Memo := TfrxMemoView.Create(Band);
    Memo.SetBounds(10, 0, 100, 20);
    memo.frame.typ:=[ftLeft,ftRight,ftTop,ftBottom];//<---
    Memo.Text := 'This memo is created in code';
    end.

    I only added then line with the frame.typ. The same error as usual. I have installed the latest Version of Fastreport3 for D6.
    Where is the problem?
  • gordkgordk St.Catherines On. Canada.
    edited 2:16PM
    here is a sample
    procedure TForm1.Button1Click(Sender: TObject);
    var
    Page: TfrxReportPage;
    Band: TfrxBand;
    DataBand: TfrxMasterData;
    Memo: TfrxMemoView;

    begin
    { clear a report }
    frxReport1.Clear;

    { add a dataset/s to the list of ones accessible for a report }
    frxReport1.DataSets.Add(frxDBDataSet1);
    // add any variables to dictionaru
    // add a category to the variables list
    frxReport1.Variables := Null;
    // add a variable to category
    frxReport1.Variables := 10;

    { add a page }
    Page := TfrxReportPage.Create(frxReport1);
    { create a unique name }
    Page.CreateUniqueName;
    { set sizes of fields, paper and orientation by default }
    { if you use call below you will pickup values for current default printer.
    along with default margin settings, if not you will get a page of a4 size and 0 for all margins}

    Page.SetDefaults;
    { modify paper's orientation interface uses clause needs printers}
    //Page.Orientation := poLandscape;
    { add a report title band}
    Band := TfrxReportTitle.Create(Page);
    Band.CreateUniqueName;
    { it is sufficient to set the ?«Top?» coordinate and height for a band }
    { both coordinates are in pixels }
    Band.Top := (page.Topmargin + 5); {added to make sure bands name tab is visible if viewing in design mode.}
    Band.Height := 20;
    { add an object to the report title band }
    Memo := TfrxMemoView.Create(Band);
    Memo.CreateUniqueName;
    Memo.Text := 'Hello FastReport!';
    Memo.Height := 20;
    //memo.Frame.typ
    memo.Frame.Typ:= [ftLeft,ftRight,ftTop,ftBottom];
    { this object will be stretched according to band's width }
    Memo.Align := baWidth;

    { add the masterdata band }
    DataBand := TfrxMasterData.Create(Page);
    DataBand.CreateUniqueName;
    DataBand.DataSet := frxDBDataSet1;
    { the Top coordinate should be greater than the previously added band's top + height}
    DataBand.Top := 100;
    DataBand.Height := 20;
    { add an object on master data }
    Memo := TfrxMemoView.Create(DataBand);
    Memo.CreateUniqueName;
    { connect to data }
    //Memo.DataSet := frxDBDataSet1;
    //Memo.DataField := 'CustNo';
    Memo.SetBounds(0, 0, 100, 20);
    memo.Memo.Add('[frxDBDataset1."CustNo"]'); // or add data this way

    { adjust the text to the object's right margin }
    Memo.HAlign := haRight;



    frxreport1.ReportOptions.Name := 'test';
    if cb1.Checked = true then
    frxreport1.DesignReport
    else
    frxreport1.Showreport;

    end;
    hope this helps.
    ;)

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.