You can use your own JavaScript functions in visual reports
and dashboards with the help of JavaScript Modules.
About this task
You use the JavaScript Module editor with syntax highlighting to write and edit your own
functions. To open the editor, select . In the New wizard, select .
After
you have created a JavaScript Module, you can save it in a repository
or file system, and then add it to a visual report or dashboard.
To add custom JavaScript functions to a visual project:
Procedure
- Open the Insert JavaScript Modules window.
In the Project Explorer view, right-click the Globals node,
and then select option.
- In the Insert JavaScript Modules window,
decide whether you need to create a JavaScript Module or attach an
existing one.
- If you decide to create a JavaScript Module, specify the
required name in the JavaScript Module name field,
select Create new, and then click Finish.
The empty JavaScript Module opens in the separate editor window. Write
the required JavaScript functions and close the editor.
- If you decide to attach an existing JavaScript Module,
select Attach to an existing, and then specify
the required module form a repository or file system. Click Finish.
Note: You can view comments added in the JSDoc format to the
script. These comments are visible to a user in the Expression
Designer.
- You can view the attached JavaScript Modules in the Project
Explorer view under the node.
Results
All the functions defined in the attached JavaScript Module
can be found in the Expression Designer under
the User node. You can use them as other expressions
in your visual project.