| Auszug |
|---|
|
Nuclos JasperReports scriptlet: JRDefaultScriptlet, Scriptlet Class, $P{REPORT_SCRIPTLET}, extension, jasperreports-6.17.0.jar. |
Language: Deutsch · English
Scriptlets
Extend report logic with a Java scriptlet – JRDefaultScriptlet, testing in the designer, registration as an extension.
| Status |
|---|
| colour | Blue |
|---|
| title | Application developer |
|---|
|
| Status |
|---|
| colour | Green |
|---|
| title | Updated: Jul 2026 |
|---|
|
| Status |
|---|
| colour | Grey |
|---|
| title | applies to Nuclos 4.2026.x |
|---|
|
What are scriptlets?
Scriptlets are custom Java classes that influence the execution of a report/form. For a simple scriptlet, derive from net.sf.jasperreports.engine.JRDefaultScriptlet (empty default methods) and override only the methods you need.
Workflow
- Create the scriptlet class and package it as a JAR.
- Test the scriptlet in Jaspersoft Studio.
- Register the scriptlet in Nuclos as an extension.
Create the scriptlet class
- Create a Java library project; keep all your classes in one package.
- Use a current JDK.
- Add
jasperreports-6.17.0.jar and further dependencies.
Test in Jaspersoft Studio
First make the class(es) known to the classpath: Extras → Options → Classpath tab, add the scriptlet JAR (and all dependencies incl. jasperreports-6.17.0.jar) via Add Jar; tick reloadable. For a single scriptlet the full class name in the document property Scriptlet Class is enough. It is called via $P{REPORT_SCRIPTLET}.method() in the image/text expression.
| Warnung |
|---|
|
Jaspersoft Studio 6.17.0 has a bug that prevents reports with scriptlets from compiling correctly. Use a different version for testing. |
| Info |
|---|
|
For reports with scriptlets to run in Nuclos, the scriptlets must be registered as server-side extensions. |
Related pages
Working with Jasper Studio
Overview.
Open →
Jasper extensions in Nuclos
Register.
Open →