Create TMemo Dynamic

edited 3:37AM in FastReport 4.0
how do I create a new dynamic tmemo adjusted dataset

Comments

  • gpigpi
    edited 3:37AM
    See a Programmer's manual 1.12 Creating a report form from code chapter:
    wrote:
    var
    DataPage: TfrxDataPage;
    Page: TfrxReportPage;
    Band: TfrxBand;
    DataBand: TfrxMasterData;
    Memo: TfrxMemoView;
    { clear a report }
    frxReport1.Clear;
    { add a dataset to the list of ones accessible for a report }
    frxReport1.DataSets.Add(frxDBDataSet1);
    { add the "Data" page }
    DataPage := TfrxDataPage.Create(frxReport1);
    { add a page }
    Page := TfrxReportPage.Create(frxReport1);
    { create a unique name }
    Page.CreateUniqueName;
    { set sizes of fields, paper and orientation by default }
    Page.SetDefaults;
    { modify paper???s orientation }
    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 := 0;
    Band.Height := 20;
    { add an object to the report title band }
    Memo := TfrxMemoView.Create(Band);
    Memo.CreateUniqueName;
    Memo.Text := 'Hello FastReport!';
    Memo.Height := 20;
    { 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);
    { adjust the text to the right object???s margin }
    Memo.HAlign := haRight;
    { show the report }
    frxReport1.ShowReport;
  • edited 3:37AM
    thank's for your help >

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.