delphireportvclfastreport

how can I lock and hide a FastReport object inspector?


enter image description hereI am using a fastreport report to create a label and then print it. but I need to show the user the TfrxDesigner from code so that they can drag and resize the components in the report's page.

with that being said, I need to lock and hide all the menus and toolbars so that users don't use them. I don't want to show or let the user use the menus in the red shape on the picture, also the data tree and all those tool bars, only the green ones.

has anyone been there? any help is appreciated, thanks!


Solution

  • You can create a TfrxDesigner instance:

      FDesigner := TfrxDesigner.Create(nil);
      FDesigner.OnShow := DesignerShow;
    

    with an OnShow handler like this:

    procedure TFRHelper.DesignerShow(Sender: TObject);
    begin
      Assert(Sender is TfrxDesignerForm);
      // Change the TfrxDesignerForm as you wish, e.g.:
      TfrxDesignerForm(ReportePrueba.Designer).ObjectsTB1.Visible := False;
      TfrxDesignerForm(ReportePrueba.Designer).StandardTB.Visible := False;
      TfrxDesignerForm(ReportePrueba.Designer).AlignTB.Visible := False;
      TfrxDesignerForm(ReportePrueba.Designer).TextTB.Visible := True;
      TfrxDesignerForm(ReportePrueba.Designer).FrameTB.Visible := False;
      TfrxDesignerForm(ReportePrueba.Designer).ExtraToolsTB.Visible := False;
      TfrxDesignerForm(ReportePrueba.Designer).DataTree.Visible := False;
      TfrxDesignerForm(ReportePrueba.Designer).Inspector.Visible := False; 
    end;