Home End User
New Blog Posts: Merging Reports - Part 1 and Part 2

How to hide Data tab in Designer

edited December 2002 in End User
On my report designer, I need to use the daIDE but when I show the designer,
I do not want to show the Data tab. How do you hide the Data tab?

TIA

Comments

  • edited December 2002
    You'll have to rebuild the project for deployment. You'll want to NOT
    include daIDE, but DO include the DADE plugin you are using, such as
    daDBBDE, daADS, daDBISAM, etc...


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    I thought I ask that question before in another name (don't worry, this is
    my real). Thanks. It worked. The last time I posted I was hoping that you
    could tell me like there is a simple comand like tabs[0].Visible := False or
    sth like that. I remembered that I place the plug-in before there and I
    remembered that I onced removed the daIDE and everything go hay-wired. I
    don't know, but thanks..

    p.s.: btw, I couldn't see my last thread regarding the save Dialog and this
    previous post too. My collegue is having the same prob.


  • edited December 2002
    Guess I have counted on my eggs too soon. The previous try it did kinda
    work, but the FieldAlias was somewhat wrong. Then I made a check and found
    that daIDE was declared there (don't know how). After removing all daIDE, I
    can't get the TppDataManager working properly.

    Urr.. Previously I was working on a way and manage to separate the DADE
    section from the Designer tab. I'm still not sure how I pull that off so I
    don't really know the in-outs of what is going on back there. I remembered
    that I removed the daIDE at one point because I don't want it to show at
    Designer's form then the whole TdaDataManager wouldn't work properly (or
    maybe it was the TdaDataModule).

    here's a screen shot of the problem...
    I've included daIBExpress unit as you've mentioned (I'm using Firebird).

  • edited December 2002
    Sorry, for the delay, my newsreader stuck this up high where i didn't see
    it. You can't remove the data tab and then use the datamanager. This is what
    happens when you remove the data tab:

    ppUnRegisterDesignModule(TdaDataManager, 'TppDesignerWindow');

    This will cause the data manager to be unregistered and hence, you can't use
    it in your custom DADE:

    procedure ppUnRegisterDesignModule(aDesignModuleClass: TppDesignModuleClass;
    const aComponentDesignerClassName: String);
    var
    lClassList: TStringList;
    lsComponentDesignerClassName: String;
    lDesignModuleClass: TppDesignModuleClass;
    lbClassRemoved: Boolean;
    liIndex: Integer;
    begin

    if (aDesignModuleClass = nil) or (aComponentDesignerClassName = '') then
    Exit;

    UnRegisterClass(aDesignModuleClass); <--here it is

    if (FDesignModuleClassList = nil) then Exit;

    lClassList := ppGetDesignModuleClassList;

    liIndex := 0;
    lbClassRemoved := False;

    while not(lbClassRemoved) and (liIndex < lClassList.Count) do
    begin
    lsComponentDesignerClassName := lClassList[liIndex];
    lDesignModuleClass :=
    TppDesignModuleClass(lClassList.Objects[liIndex]);

    if (lsComponentDesignerClassName = aComponentDesignerClassName) and
    (lDesignModuleClass = aDesignModuleClass) then
    begin
    lClassList.Delete(liIndex);

    lbClassRemoved := True;
    end

    else
    Inc(liIndex);
    end;

    end; {procedure, ppUnRegisterDesignModule}

    RB doesn't expect the datamanager to be around unless it is part of the
    designer. This is just an assumption we made when we built it. You'll have
    to re register the class with Delphi and take it from there. I'd have to
    code a full example to know how exactly to do this, but there are more
    dependencies that will arise once you get past this point. Just let us know
    and we'll see what we can do as you run into them.


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    from how I am seeing it now, I don't think I can UnRegister the
    TdaDataManager. Really no way no how. Isn't there a way to shut the tab
    visually?? I mean I don't mind having the object floating around because
    without it some of my parts won't work. I just want the tab to be invisible
    or hidden or taken off, visually.

    Sorry for stressing the thing, it's just that I just want to hide the tab,
    it shouldn't sound that difficult. I have the source and stuff and the whole
    tab is published. *sigh*.


  • edited December 2002
    If daIDE is in your uses clause then you can access the data tab in code:

    uses
    ppDsgner
    ...
    TppDesignerWindow(ppDesigner1.Form).Notebook.Pages[0]


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited December 2002
    Thanks. I finally got it working now.

    procedure TfrmRBDesigner.ppRBDesignerShow(Sender: TObject);
    begin
    if Pos('Data',
    TppDesignerWindow(ppRBDesigner.Form).Notebook.Pages[0].Caption) <> 0 then
    TppDesignerWindow(ppRBDesigner.Form).Notebook.Pages[0].Free;
    TppDesignerWindow(ppRBDesigner.Form).Notebook.ActivePageIndex := 1;
    end;

    I couldn't just Hide the tabsheet so I free it. I'm not sure if this will
    cause some unnessesary AV.

This discussion has been closed.