Default settings frxDesigner/frxReport

mierlpmierlp Netherlands
edited 4:38AM in FastReport 4.0
Hi,

I was wondering how to use the default settings within the frxDesigner into a new created
default report.
- Within the frxDesigner i set left,right,top,bottom marge to 0.
- Witin a frxReport i set the DataSetName to my default dataset which will be used to created report.

When i create a new report within the runtime frxDesigner the marges are set on10 instead of 0,
which i defined. The same is for the dataset and i have to assign the the dataset again to the report.

Regards Peter

Comments

  • gpigpi
    edited 4:38AM
    Try to use:
    procedure TForm1.MyNewBClick(Sender: TObject);
    begin
      TfrxDesignerForm(frxReport1.Designer).NewReportCmdExecute(nil);
      TfrxReportPage(frxReport1.Pages[1]).LeftMargin := 0;
      TfrxReportPage(frxReport1.Pages[1]).RightMargin := 0;
      TfrxReportPage(frxReport1.Pages[1]).TopMargin := 0;
      TfrxReportPage(frxReport1.Pages[1]).BottomMargin := 0;
      frxReport1.DataSets.Clear;
      frxReport1.EnabledDataSets.Clear;
      frxReport1.DataSets.Add(frxDBDataset1);
      frxReport1.EnabledDataSets.Add(frxDBDataset1);
      frxReport1.DataSet := frxDBDataset1;
      frxReport1.Designer.ReloadPages(1);
    end;
    
    procedure TForm1.MyNewPageBClick(Sender: TObject);
    begin
      TfrxDesignerForm(frxReport1.Designer).NewPageCmdExecute(nil);
      TfrxReportPage(frxReport1.Pages[frxReport1.PagesCount - 1]).LeftMargin := 0;
      TfrxReportPage(frxReport1.Pages[frxReport1.PagesCount - 1]).RightMargin := 0;
      TfrxReportPage(frxReport1.Pages[frxReport1.PagesCount - 1]).TopMargin := 0;
      TfrxReportPage(frxReport1.Pages[frxReport1.PagesCount - 1]).BottomMargin := 0;
      frxReport1.Designer.ReloadPages(frxReport1.PagesCount - 1);
    end;
    
    procedure TForm1.frxDesigner1Show(Sender: TObject);
    begin
         TfrxDesignerForm(Sender).NewB.OnClick := MyNewBClick;
         TfrxDesignerForm(Sender).NewPageB.OnClick := MyNewPageBClick;
    end;
    

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.