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.
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.
Recommended Comments
There are no comments to display.