Configuring Studio Reports Events
Script Editor to Configure Events
To access the Script Editor,
On the Desktop Studio screen, click button from the toolbar.OR
On the Desktop Studio from Tools Menu, click Scripting. The Script Editor – JScript screen appears.Figure 1: Script Editor
Compiling scripts
After entering the script, you can compile the script to ensure it will run without error and you will be able to achieve the results that you want using the script.
Figure 2: Syntax success in the script
To compile the script, click the Compile button available on Script Editor – JScript screen.
If the script has any syntax error, it is listed in a pane opening between script pane and buttons. You can remove the errors and re-click the Compile button to make sure the script is error-free.
Figure 3: Syntax error in the script
Find and Replace
Script Editor screen offers Find and Replace functionality.
Click button on the toolbar of Script Editor or press Ctrl + F on the keyboard to switch on the functionality.
Figure 4: Find and Replace feature on Script Editor
You have options to search up and search down. Selecting Match Case will conduct a case sensitive search. Selecting Match whole word only will not find the words where the search string is part of a word. A click on Find Next button will start search.
If you want to carry out find and replace, select Find and Replace check box. Clicking Replace will replace the next occurrence of the search sting. Clicking Replace All will search for all the occurrences of the search string.
You can use the following objects and their properties to control the behavior of the report at runtime. These report objects are accessible in a specific hierarchy as explained below:
Figure 5: Report Object Hierarchy
The objects or events in the code editor are dependent on each other, for one object there is a specified set of events and vice-versa.
Context-Sensitive Help
The Script Editor also provides context-sensitive help that assists in correct code (syntax) formation.
Figure 6: Context-Sensitive Help
As you enter the code in the Script Editor, the context-sensitive help keeps popping up selection list of various fields and objects that may fit into the syntax.
For example, if you enter rpt. (rpt dot), it will pop up the selection list as shown in the above figure.
Accessing Fields
You can access the report fields in ‘rpt.Fields’ collections. You can use this collection to write code in the Script Editor to access fields (controls) in the layout pane. Each event in the Script Editor has a specific purpose. You should not write a code that does not pertain to the object / event under which it has been written.
To add a new code under the data Initialize event of the Intellicus Report Layout, the syntax is:
rpt.fields.add “<MyField>”;
Warning: Make sure that the added field does not already exist; else, a fatal error will occur.
Code script for the value property of the fields can be given under ‘OnFetchData’ event of Intellicus Report Layout.
rpt.fields(“SomeFieldName”).value=”<SomeValue>”;
Accessing Layout Objects
The layout objects are the controls that are added to the report layout region. You can access these objects through control’s collection members of the sections collection.
rpt.sections(“Detail”).Controls(“imgLogo”).visible = false;
Important: You will not be able to access the database using code (scripts).
Related content
Copyright Kyvos, Inc. All rights reserved.