Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Content layer
id1331136403
Content column
id1331136405
Content block
id1331136405

JavaScript tool enables report templates to evaluate or run JavaScript codes from templates and external JavaScript files, see figure below.

The general concept behind this JavaScript feature is to separate complex business logic from presentation logic. Complex logic should be executed by JavaScript, and presentation logic should be executed by Velocity code.

Class Diagram: JavaScript tool.

JavaScript tool includes 3 methods:

(i) 'eval' Method
     this method will evaluate JavaScript text, and then return the result.
(ii) 'execute' Method 
     this method will execute a JavaScript file, and then return the result.
(iii) 'call' Method 
      this method will call a JavaScript function, and then return the result.

Like other Custom tools, the JavaScript tool 'scripttool.jar' must be installed in the 'extensions' folder of the Report Wizard plugin, and 'js.jar' must be included in any class path or the 'extensions' folder. For further information about Custom tools and the installation, see Custom tool.

To import JavaScript tool to a template type, for example:

Code Block
#import('js', 'com.nomagic.reportwizard.tools.script.JavaScripttoolJavaScriptTool')
Content block
id1331136402

Related pages

Children Display