A command button is typically used to initiate or activate a process or action.
The exercise in this section assumes that you have previously inserted a new Dashboard section in Sample3.bqy and renamed the new section Controls. |
If you need to change the text color or the color of the actual command button, use graphic object to create your own button. For more information, see Creating a Custom Button. |
To associate a script with a command button:
Elements pane, drag a command button control to the Content pane and use the Properties dialog box to specify its title as RevSummary
From the Elements pane, drag a command button control to the Content pane and use the Properties dialog box to specify its title as RevSummary.
(See Changing a Control Object Title for detailed instructions.)
With the RevSummary object’s selection handles visible, choose Dashboard , then Scripts or press F8.
The objects name (as shown in the Name field of the Properties dialog box) is displayed on the Title bar of the Script Editor, and the default event for the object (OnClick) is displayed in the Event drop-down box.
Use the Object browser to navigate to ActiveDocument , then Sections, then RevSummary, and then Methods.
Interactive Reporting automatically enters the correct command in the Script Editor.
Toggle to Run mode, press Ctrl+D and click the RevSummary button.
You have just learned to associate a script with a command button. You can review your script by activating the Controls Dashboard section, toggling to Design mode, and opening the Script Editor for the command button.
Create another button. Associate the button with a script that duplicates the RevSummary section. You can also try this on other Interactive Reporting document files.
ActiveDocument.Sections[“RevSummary”].Duplicate()