Jump to content
We've recently updated our Privacy Statement, available here ×
  • Hide search results


    mdahlman
    • Version: v4.7

    Purpose

    The purpose of this article is to provide a way for administrators to hide certain repository items from being seen by search results and the Repository and Library view of JasperReports Server.

    This does not replace the comprehensive capabilities of the repository permissions system that is well described in Chapter 3 of the JasperReports Server Admin Guide. For example, the Execute Only permissions implemented in version 4.0 of JRS are very powerful and can cover most use cases.

    A common use case for this would be for hiding reports that are only used for drill-through from another report or dashboard

    This how-to was tested on JasperReports Server 4.7

    File to Edit

    The file you will edit can be found in /webapps/jasperserver-pro/scripts/repository.search.main.js

    Around line 1065 of the file you will find three lines like this:

    fire: function(eventName, memo) { 
        this._getContainer().fire(eventName, memo); 
    }, 
    

    Add some lines to make it look like this:

    fire: function(eventName, memo) { 
        this._getContainer().fire(eventName, memo); 
    
        var $resultsLists = $$('li[id^="resultsList"]'); 
        $resultsLists.each(function(result){ 
            result.descendants().each(function(node) {
                if(node.innerHTML.indexOf("HIDDENITEM") != -1) { 
                    result.update(); 
                } 
            });
        });
    },
    

    How To Use

    The code above effectively hides any element with the keyword HIDDENITEM in the repository view. The keyword can be applied to the title or the description of a report unit (or any unit). It is also case sensitive.

    Edit_jrs.png.8c3b63f2d66f192867efff98c52378e5.png

    NOTE: Once you've hidden the report with the above method then the only way to edit it will be using iReport Designer's Repository Navigator as it won't be available from the repository.

    Edit_ireport.png.1e934a33753bc7e42a83fddfe84c4917.png

     

    User Feedback

    Recommended Comments

    There are no comments to display.



    Guest
    This is now closed for further comments

×
×
  • Create New...