Search code examples
jasperserver

How to get name of report used by different user in jasperserver


I am using jasper server enterprise version 7.0. Multiple users login to the server I can get the user name by using parameter - LoggedInUsername. But how can i get which report is used by the Logged in user. Is there any method to do so or is there any workaround for this?


Solution

  • Inside a report template (JRXML), you can get its own name calling $P{JASPER_REPORT}.getName(): Screenshot of Jaspersoft Studio's Expression Editor, for adding built-in Parameter $P{JASPER_REPORT} to Text Field

    And this is what you see when it's published to the server (6.4.2 in my case): Screenshot of JASPER_REPORT.getName() test on JasperReports Server As you can see from the screenshot, the report file name and report name do not necessarily have to match.

    For further details, see: http://jasperreports.sourceforge.net/api/net/sf/jasperreports/engine/JRParameter.html#JASPER_REPORT