Hi
I am using JasperReports Server 5, and I am new to it. My requirement is to customize UI based on selected locale for e.g. if user wants to show/hide some of the links(in jasperserver) only for french locale not for english locale.
If anybody knows how to get selected locale inside jasperserver then share details with me. I am also simultaneously going through documentation and web help to acheive the same.
- Log in or register to post comments
2 Answers:
I found a way to get the locale in a JSP page
You need to import a class first:
<%@ page import="com.jaspersoft.jasperserver.war.common.JasperServerConstImpl" %>
Then you have access to the Locale:
<%=session.getAttribute(JasperServerConstImpl.getUserLocaleSessionAttr())%>
I tried this in the "about" box and once logged in was able to see en_US
Sounds like something along the lines of creating variable with:
(LocaleEnglish != english) ? LocaleFrenche : LocaleEnglish
But that limits it to EN and FR
thanks for quick response , i wanted to know whether jasperserver is keeping any variable in session or context for selected locale so that i can use to conditionally hide/show not only links other UI stuffs also , i am just thinking in one direction to address this problem , there may be easy ways to achieve this