Interactive scripting sample 2
The interactive context menu shown in Figure 5‑5 shows the following scripts changing interactive features:
*A script removes the user option to enable interactivity.
*A script removes the user option to filter, group, and aggregate values in the report.
*A script enables interactivity when the BIRT design is viewed.
Figure 5‑5 Custom interactive context menu
The script written to change the context menu appears in Listing 5‑2.
Listing 5‑2 Removing filter, group, and aggregation options
// Get the Viewer's current UI Options
var uiOptions = this.getViewer().getUIOptions();
// For security reasons, enable Interactive Viewer with only a
// fixed set of interactive functionality to the users.
//hide Enable/Disable Interactivity
uiOptions.enableEditReport(false); //hide interactivity option
uiOptions.enableGroupEdit(false); //hide move/add/delete Group
uiOptions.enablePageBreak(false); //hide page break
uiOptions.enableAggregation(false); //hide Aggregation
uiOptions.enableFilter(false); //hide Filter
// Set the modified UI Options back into the Viewer
// If Interactivity is not enabled, enable it
if (!this.getViewer().isInteractive())