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

How to retrieve report name from within scriptlet


mulcamd

Recommended Posts

How can I, from within a scriptlet, retrieve the name of a report.

The name of the report is in the JRXML <jasperReport ... name="TestImage" ...>

So in my scriptlet I want to access the name attribute and get TestImage.

Please could anyone drop a line of scriptlet code ...

Code:
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="TestImage" language="groovy" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

i don't know how to retrieve the report name in scriptlet directly, but one workaround is that you can define a paramete in .jrxml and set the default value to the report name, then get this paramete in scriptlet.

Link to comment
Share on other sites

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