More Report Scripting

Fixed Value Selection

See Also Syntax Auto-Completion, for information on property name suggestions. When you use the Script Editor to assign a value to a property, the Editor can provide you with a menu of available values. This helps you to avoid syntax errors and choose an acceptable values.

To use the Editor's menu of values, follow the steps below:

1. In the Script Editor, type a property name followed by an “equals” sign. For example: Text1.font = When you enter the “equals” sign, the Editor prompts you with a menu of available options.

2. Select the 'Edit Value' option in the menu. This opens the 'Property Value' dialog box.

3. Choose the desired value in the dialog box, and click 'OK'.

This adds the appropriate value to your script (e.g., [255,0,0] for the color red).


Census example

Reporting Software Demo
Register



college enrollment dashboard

Syntax Checking

When you save a script, the Script Editor automatically checks the script's syntax. If the Editor finds a syntax problem, it provides a description and location for the error. Because the source of the error may not lie on the flagged line, you should always check the lines adjacent to the flagged location. Mismatched parentheses and missing delimiters/operators on the preceding lines are a very common cause of errors.

Because JavaScript is a weakly-typed language, it is not possible for the Editor to check for correct variable usage. For example, the syntax checker cannot detect whether a script references a non-existent variable. However, this kind of error will be reported in the Console window when you preview the report in Report Designer. See Script Debugging for more information about using the Console window.

Editing Multiple Element Scripts

When the Script Editor is open, you can access scripts for multiple report elements, as well as report-level scripts. Follow the steps below: 1. In the Script Editor, click the 'Script Explorer' button. This displays a report element tree. 2. Select an element from the tree to view and/or edit the element's script.