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

Deactivate menu options

edited May 2008 in RAP
Hello,

We are trying to deactivate the "save as", "Import", "Export" options
in the report builder menu's (Design, Preview, Data, Calc).

So far I've managed to "find" the code and deactivate everything but
the Calc (RAP).

We don't have the code of rap so I don't know where the menu's are.

This is the code for the design tab.
---------
if (ppDesigner.Form.DesignModules.Items[iLoop] is
TppDesignLayoutManager) then
begin
with
TppDesignLayoutManager(ppDesigner.Form.DesignModules.Items[iLoop]).ToolManager.Menubar
do
begin
FileMenu.SaveAs.Visible := False;
end;
end;
---------

Is there something similar I can do for the calc tab?
(Or another may be "easier" way to do it ?!?!)

Thankx,
Chantal

Comments

  • edited May 2008
    Hi Chantal,

    Take a look at the following example on hiding the DADE menu items. You
    should use a similar method to hide the RAP menu items. Below are the
    changes that need to be made.

    http://www.digital-metaphors.com/tips/Designer10-HideDataMenuItems.zip

    uses
    raIDE;

    procedure TForm1.ppDesigner1TabChanged(Sender: TObject);
    var
    lSubMenu: TppTBCustomItem;
    lCodeFileMenu: TraCodeFileSubMenu;
    begin

    if (ppDesigner1.Notebook.ActivePageIndex = 1) then //Calc tab
    begin

    // this can be used to get at any menu times
    lSubMenu := ppDesigner1.Menu.Items[0]; // get file menu
    ShowMessage(lSubMenu.Items[0].Caption);

    // For the Data | File menu we can typecast as TdaDataFileMenu

    // The TdaDataFileMenu class has properties that correspond to the
    items,
    // see RBuilder\Source\daDataManager for the class declaration
    if (lSubMenu is TraCodeFileSubMenu) then
    begin
    lCodeFileMenu := TraCodeFileSubMenu(lSubMenu);

    lCodeFileMenu.Export.Visible := False; // hide Export menu item

    end;

    end;

    --
    Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com

    Best Regards,

    Nico Cizik
    Digital Metaphors
    http://www.digital-metaphors.com
  • edited June 2008
    Thankx a lot,

    Chantal

    On Fri, 30 May 2008 08:45:06 -0600, "Nico Cizik \(Digital Metaphors\)"
This discussion has been closed.