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

Do not allow user to [Save As] for TppDesigner

edited September 2002 in End User
I do not want users to simply access other reports and override the report.
So I wish to implement in a way that do not allow the designer to use Save
As.. but only Save. Can I diable some of the menu options?? Also, if is
there a way to add new menu items to the menu bar??

TIA

Comments

  • edited September 2002
    Here is an example which shows how to disable the save menu item. You can
    determine which tab you are in and can disable the proper menu item.

    http://www.digital-metaphors.com/tips/HideSave.zip


    You can add menu options by using the merge menu property. Here is an
    example:

    http://www.digital-metaphors.com/tips/MergeMenuWithDesigner.zip


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002
    Ok Ok, I've fingured out how to do this. but I still need another help, how
    to disable the Open button in the component tab?? you know, those reside
    inside the tabcontrol??

  • edited September 2002
    Thanks for pointing this out. What you can do before you show the designer,
    is disable the standard toolbar, both the menu option and the toolbar.

    {disable standard toolbar}
    ppDesigner1.Menu.Items[2].Items[0].Items[0].Visible := False;
    TppDesignerWindow(ppDesigner1.Form).ToolBarManager.RemoveToolbar('StandardTo
    olBar');


    Cheers,

    Jim Bennett
    Digital Metaphors

  • edited September 2002
    There is a loop hole in your HideSave demo. You have hide the save option
    from the user on the menu side, but what about the toolbar?? I mean, you can
    bring the standard toolbar out and the user can save the report using that
    function.That's why I brought up the issue about the toolbar thing. It is
    not only Save As... I do not want to allow my users to access, but also the
    Open. I don't want to allow unauthorized users to snoop around my report
    applications.

    Thanks for the tips though. At least your way looks cleaner then mine. :)

  • edited December 2002
    This works for me:

    On ppDesigner1.OnChangeTab:

    If (ppDesigner1.Notebook.ActivePage = 2) or (ppDesigner1.Notebook.ActivePage
    = 3) then
    //designer/preview tab (same menu)
    begin
    ppDesigner1.menu.Items[0].Items[6].visible := False;
    // File | Save As
    ppDesigner1.menu.Items[0].Items[2].visible := False;
    // File | Open
    if ppDesigner1.Menu.Items[2].items[0].Items[5].Checked = True then
    // if visible then click to hide
    ppDesigner1.Menu.Items[2].items[0].Items[6].Click;
    // remove from menu so can't be made visible
    ppDesigner1.Menu.Items[2].items[0].Items[5].Visible := False;
    end;

    Hope this helps someone,

    Leah

This discussion has been closed.