Prevent 'Send to Excel' from Workspaces

SOLVED

We have a customer who would like to prevent users mass exporting data to Excel.

We would need to prevent access to List Views because I understand it's currently not possible to prevent the Send to Excel option on those.

Instead we're looking at using Workspaces, but again the same challenge - can we remove the 'Send to Excel...' options?  It's not an option in Workspace Designer.

I know some things that you can't do in Workspace designer but are achievable by editing the XML files directly, so I'm wondering if this is actually possible.

Thanks in advance.

  • 0

    There will be a way of doing this for the list views - I just haven't thought of it yet (aside from replacing them all with custom versions, which isn't difficult, just a lot of work).

    But as for the Workspaces - yes, if you edit the Content Part manually. All you need to do is add an element like this:

    <Export IsVisible="false" />

    Just add that after the <Reports></Reports> element for each of the contents parts that you want to affect (can't do it universally as far as I'm aware).

    You're probably best off editing the relevant content parts using the designer, just so you'll get the files created in your Sage\im content\modifications\content partsv7 folder and then edit them in there and do the usual application pool restarts to get Sage 200 to recognise the change.

    Here's one I've just edited on my machine:

      

  • +1 in reply to Chris Burke
    verified answer

    Oh. But this only does half a job, thanks to the function in sage.widgets.listcontentpart.js that's responsible for drawing the context menu. Yes, the 'export' option will be removed from the action bar at the top of the content part, but it'll still get put on the right-click menu. Great stuff.

    If you edit the sage.widgets.listcontentpart.js file (it's in inetpub/Sage 200 Self Service/Sage200SelfSeervice/Scripts) and find the $.contextMenu function it should be apparent what's going on. This particular bit of code (edited for brevity) ...

    menuItems.exp = {
        name: 'Export',
        accesskey: 'X',
        items: {
            excelall: {
            name: 'All to Excel',
        
        . . .
                                       
        };

    ...*should* really look like this:

    if(o.export.isVisible) {
        menuItems.exp = {
            name: 'Export',
            accesskey: 'X',
            items: {
            excelall: {
            name: 'All to Excel',
    
        . . .
        
        };
    }

    Is it advisable to edit this file? Probably not. Would I do it? Yes.

  • 0 in reply to Chris Burke

    Thanks Chris that worked fine once I tried it on a custom content part instead of the core XML file. 

    Interesting that you say it should be possible to do the same for list views, if you think of a way (other than replacing) I'd be interested to hear it!