The home page is the first page a user sees when logging in to JasperReports Server. You can set the home page to a specified flow based on user role.
Setting the Library as the Home Page:
The following example shows how to set the library page as the home page of a non-administrative user:
| 1. | Open the file <js-webapp>WEB-INFjasperserver-servlet-pro.xml (commercial editions) or jasperserver-servlet.xml (community edition) for editing. |
| 2. | Locate the home page bean: |
proHomePageByRole (commercial editions)
homePageByRole (community edition)
| 3. | Locate the line under this bean for ROLE_USER and modify it to direct to the library page: |
| For a user with multiple roles, the proHomePageByRole bean redirects the user to the page specified by the first matching role on the list. For example, for an administrator with ROLE_ADMINISTRATOR and ROLE_USER roles, the ROLE_ADMINSTRATOR redirect is applied because it appears first in the bean. When adding your own roles to this bean, insert them in the order that works for you. |
| 5. | Log into JasperReports Server as joeuser. The library page is displayed. |
| You can use this method for dashboards. For example: ROLE_ADMINISTRATOR|redirect:/dashboard/viewer.html#/public/Samples/Dashboards/1._Supermart_Dashboard[/code] This method does not work with viewReportFlow. |
Setting a report as the home page:
The following example shows how to set a report as the home page based on a role. This example uses the 01. Geographic Results by Segment Report.
| 1. | First, set up the role and create a sample user: |
| a. | Create the role you want to use, for example, ROLE_REPORT_HOME. |
| b. | Create a user HomeUser and add ROLE_REPORT_HOME to HomeUser. |
| 2. | Open the file <js-webapp>WEB-INFjspmoduleshomehome.jsp in an editor and add the following lines: |
| To find the URI for the report you want to use, open the report in the repository and copy the URI. |
| 3. | Save the modified file and restart the application server to see changes. |
| 4. | Log into JasperReports Server as HomeUser. The report is displayed. |
Recommended Comments
There are no comments to display.