Jump to content
We've recently updated our Privacy Statement, available here ×

Need Help on How to Remove Export Formats Based on User Roles?


alexmich

Recommended Posts

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-1

screenshot-1.png.5c9c561828fd5ca1cd3f62abfbf85302.png

Screenshot-2

screenshot-2.png.f73b579a402089a14780007f81664b6a.png

Screenshot-3

screenshot-3.png.dddc6c4b0a5c5f083a8aa9fe54f6cdd5.png

Screenshot-4

screenshot-4.png.4148a332f4c10389c6e3353f1b60939f.png

Screenshot-5

screenshot-5.png.d50c394ae7f59f27985a494d7dbfb800.png

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Posted Images

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...