alexmich Posted October 9, 2012 Share Posted October 9, 2012 Hi everyone, I need to display all the report export formats for users with administrator role only and to remove the Flash, ODS and ODT export formats for users without administrator role. I tried to do so by accomplishing 12 tasks*. After the tasks I ran the following test: a- I logged in as jasperadmin, I saw all the export formats.b- I logged in as joeuser, Flash, ODS and ODT were removed from the export menu.c- I logged back in as jasperadmin, Flash, ODS and ODT were removed from the export menu. I had to restart Tomcat to get all the export formats for jasperadmin. Your help is greatly appreciated in this matter. By the way, I am doing this on Jasper v4.5. Thank you very much. alexMichel*Below are the tasks I accomplished.1- Stop Tomcat.2- Open the file “C:Program Filesjasperperreports-server-4.5apache-tomcatwebappsjasperserver-proWEB-INFjspmodulesviewReportDefaultJasperViewerState.jsp”.3- Between “Map configuredExporters = (Map) request.getAttribute("configuredExporters");” and the for-loop, add the following lines- see screenshot-1.configuredExporters.remove("swf");configuredExporters.remove("ods"); configuredExporters.remove("odt"); 4- Save the file as CustomJasperViewerState.jsp in the same directory.5- In the same directory create a backup copy of the file “DefaultJasperViewer.jsp”- for example, “BACKUP_DefaultJasperViewer.jsp”.6- Open the file ”DefaultJasperViewer.jsp”.7- Add the following taglib directive- see screenshot-2.http://www.springframework.org/security/tags" prefix="authz"%>8- Under “” add the following lines - see screenshot-3. 9- Save the file in the same directory.10- Start Tomcat.11- Check the export menu when being logged in as jasperadmin (looks like screenshot-4).12- Check the export menu when logged in as joeuser (looks like screenshot-5). Screenshot-1Screenshot-2Screenshot-3Screenshot-4 Screenshot-5 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now