globe with meridians Language: Deutsch · English

hammer and wrench Scriptlets

Extend report logic with a Java scriptlet – JRDefaultScriptlet, testing in the designer, registration as an extension.

HOW-TO APPLICATION DEVELOPER UPDATED: JUL 2026 APPLIES TO NUCLOS 4.2026.X

On this page

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

  1. Create the scriptlet class and package it as a JAR.
  2. Test the scriptlet in Jaspersoft Studio.
  3. 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.

Known bug

Jaspersoft Studio 6.17.0 has a bug that prevents reports with scriptlets from compiling correctly. Use a different version for testing.

Register in Nuclos

For reports with scriptlets to run in Nuclos, the scriptlets must be registered as server-side extensions.

Related pages

printer Working with Jasper Studio


Overview.

Open →

electric plug Jasper extensions in Nuclos


Register.

Open →

  • Keine Stichwörter