Customize Designer

rfcrfc
edited 1:10AM in FastReport 4.0
Is there a way to hide the Data tab at design-time ?
I have tried setting drDontEditReportData at Designer component, but it dosn't work.

Any help would be apreciated.

Comments

  • gpigpi
    edited 1:10AM
    This is impossible without changes of frxDesgn.pas:
    procedure TfrxDesignerForm.ReloadPages(Index: Integer);
    var
      i: Integer;
      c: TfrxPage;
      s: String;
    begin
      FDialogForm := nil;
      FTabs.Tabs.BeginUpdate;
      FTabs.Tabs.Clear;
      FTabs.Tabs.Add(frxResources.Get('dsCode'));
    
      for i := 0 to Report.PagesCount - 1 do
      begin
        c := Report.Pages[i];
        c.IsDesigning := True;
        if (c is TfrxReportPage) and (TfrxReportPage(c).Subreport <> nil) then
          s := TfrxReportPage(c).Subreport.Name
        else if c is TfrxDataPage then
          s := frxResources.Get('dsData')
        else if c.Name = '' then
          s := frxResources.Get('dsPage') + IntToStr(i + 1) else
          s := c.Name;
        if s <> frxResources.Get('dsData') then // add
        FTabs.Tabs.Add(s);
      end;
    
      FTabs.Tabs.EndUpdate;
    
      if Index = -1 then
        Page := nil
      else if Index = -2 then
      begin
        for i := 0 to Report.PagesCount - 1 do
        begin
          c := Report.Pages[i];
          if not (c is TfrxDataPage) then
          begin
            Page := c;
            break;
          end;
        end;
      end
      else if Index < Report.PagesCount then
        Page := Report.Pages[Index] else
        Page := Report.Pages[0];
    end;
    
    procedure TfrxDesignerForm.TabChange(Sender: TObject);
    begin
      if FTabs.TabIndex = 0 then
    {$IFDEF FR_VER_BASIC}
        FTabs.TabIndex := 1 else
    {$ELSE}
        Page := nil else
    {$ENDIF}
        Page := Report.Pages[FTabs.TabIndex {- 1}];  //change
    end;
    
  • edited 1:10AM
    Good morning,

    Excuse me but where is the TfrxDesignerForm.ReloadPages event ?
    I don't see it in the TfrxDesigner1 component.

    Thanks for the answer
  • edited 1:10AM
    Sorry for the lazy question i found what is, i didn't understood that it had to change in the frxDesgn.pas.
    in my case i wanted to hide the tab code i just changed the line :
    wrote:
    if s <> frxResources.Get('dsData');
    by
    wrote:
    if s <> frxResources.Get('dsCode') then

    and i disabled the line :
    wrote:
    FTabs.Tabs.Add(frxResources.Get('dsCode'));


    In the first time that hide the tab code but when i click on the tab data that show the editor code wich it must be hided.

    If someone have any idea ?

    Sorry for my english.....
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 1:10AM
    Can't you simply do this?
    LTab :=  FTabs.Tabs.Add(frxResources.Get('dsCode'));  // I assume it returns the tab just added, or maybe its index
    LTab.visible := false;
     or 
    LTab.TabVisible := false;
    

    Sorry, I don't have the source code, so I'm just guessing
  • edited 1:10AM
    thanks for your help but it doesn't work

    yes indeed,
    wrote:
    FTabs.Tabs.Add(frxResources.Get('dsCode'));
    return the index which is an integer so we can't use LTab.visible:= false or true

    i tried that :
    wrote:
    LTabs: TTabControl;

    .......

    FTabs.Tabs.Add(frxResources.Get('dsCode'));
    LTabS := FTabs;
    LTabS.visible := false;

    with that code that hide all the tabs

    maybe it's a step and i am not far, i search again.......... >
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 1:10AM
    Well, then:
    LTabs: TTabControl;
    LIdx: integer;
    .......
    
    LIdx:=  FTabs.Tabs.Add(frxResources.Get('dsCode'));
    LTabS :=  FTabs[LIdx]; 
    LTabS.visible := false;
    
  • edited 1:10AM
    It doesn't work with that line :
    wrote:
    LTabS := FTabs[LIdx];

    the error is :
    wrote:
    Class does not have a default property
  • Anu de DeusAnu de Deus Hampshire, UK
    edited 1:10AM
    Try this instead:
    LTabS := FTabs.tabs[LIdx];
    
  • edited 1:10AM
    i 've got the message :
    wrote:
    Incompatible types: 'TTabControl' and 'String'

  • Anu de DeusAnu de Deus Hampshire, UK
    edited 1:10AM
    Well, I'm out of ideas now.
    Sorry I can't help any further

Leave a Comment