Input Controls with Custom Functions¶
Input Controls with custom functions in JasperReports Server are user-defined components that allow you to filter or provide specific input for reports or dashboards. It provides advanced user interface elements that go beyond the basic, built-in types to collect parameters from the user before running a report.
You can provide an custom expression using a subset of DomEL or call custom JavaScript/Groovy functions defined in the /WEB-INF/custom_functions/ directory.
To create an input control with custom functions:
-
Follow steps 1 through 8 in the Input Controls section.
-
In the Display Settings section, select the custom input control options in:
- Enable/Disable Input Control > Conditional
- Show/Hide Input Control > Conditional
Note
For more information, see the Input Controls with Custom Expressions section in the JasperReports Server User Guide.
-
Call the custom Javascript/Groovy functions defined in the
WEB INF/custom_functionsdirectory:-
HasAnyRoles('ROLE_SUPERUSER')
-
startsWith(Country,'M')
-
contains(Country, 'ca')
Following are examples of the
contains.jsandcontains.groovycustom functions defined in the/WEB-INF/custom_functionsdirectory.-
contains.js -
contains.groovy
-