Controlling Interactive Viewer user interface features
The BIRT Interactive Viewer enables users to perform a number of custom operations on a BIRT design or document and save or print changes as a new design or document. The file and print features for Interactive Viewer are available in the main menu of the BIRT viewer, as shown in
Figure 13‑7.
Figure 13‑7 Interactive Viewer menu
The actuate.viewer.UIOptions class can enable or disable any of the interactive features, including enabling and disabling interactivity. This restricts access to features that aren’t useful to the user or that aren’t supported by the iHub application.
All actuate.viewer.UIOptions enable functions accept a Boolean input parameter, which if true enables an interactive feature and if false disables an interactive feature. To display the list of currently enabled and disabled features, use actuate.viewer.UIOptions.getFeatureMap( ).
Table 13‑1 contains a complete list of actuate.viewer.UIOptions enable functions that control features.
Table 13‑1 UIOptions enable feature functions
Function | Interactive feature |
enableAdvancedSort( ) | Enables the advanced sort feature |
enableAggregation( ) | Enables the aggregation feature |
enableCalculatedColumn( ) | Enables the calculated column feature |
enableChartProperty( ) | Enables the chart properties feature. |
enableChartSubType( ) | Enables the chart subtype selection feature |
enableCollapseExpand( ) | Enables the collapse/expand feature |
enableColumnEdit( ) | Enables the column editing feature |
enableColumnResize( ) | Enables the column resizing feature |
enableContentMargin( ) | Enables the content margin feature |
enableDataAnalyzer( ) | Enables the Launch Interactive Crosstab feature |
enableDataExtraction( ) | Enables the data extraction feature |
enableEditReport( ) | Enables the report editing/interactivity feature |
enableExportReport( ) | Enables the export report feature |
enableFilter( ) | Enables the filter feature |
enableFlashGadgetType( ) | Enables the flash gadget type change feature |
enableFormat( ) | Enables the format editing feature |
enableGroupEdit( ) | Enables the group editing feature |
enableHideShowItems( ) | Enables the hide/show item feature |
enableHighlight( ) | Enables the highlight feature |
enableHoverHighlight( ) | Enables the hover highlight feature |
enableLaunchViewer( ) | Enables the Launch Viewer feature |
enableLinkToThisPage( ) | Enables the "link to this page" feature |
enableMainMenu( ) | Enables the main menu feature |
enableMoveColumn( ) | Enables the column moving feature |
enablePageBreak( ) | Enables the page break editing feature |
enablePageNavigation( ) | Enables the page navigation feature |
enableParameterPage( ) | Enables the parameter page feature |
enablePrint( ) | Enables the print feature |
enableReorderColumns( ) | Enables the column reordering feature |
enableRowResize( ) | Enables the row resizing feature |
enableSaveDesign( ) | Enables the report design save feature |
enableSaveDocument( ) | Enables the report document save feature |
enableServerPrint( ) | Enables the server-side printing feature |
enableShowToolTip( ) | Enables the show tooltip feature |
enableSort( ) | Enables the sort feature |
enableSuppressDuplicate( ) | Enables the duplication suppression feature |
enableSwitchView( ) | Enables the switch view feature |
enableTextEdit( ) | Enables the text editing feature |
enableTOC( ) | Enables the table of contents feature |
enableToolBar( ) | Enables the toolbar feature |
enableToolbarContextMenu( ) | Enables the show toolbar features in a context menu |
enableToolbarHelp( ) | Enables the toolbar help feature |
enableTopBottomNFilter( ) | Enables the top N and bottom N filter feature |
enableUndoRedo( ) | Enables the undo and redo feature |
The viewer does not accept UIConfig changes after it loads. The only way to reset UIConfig options is to reload the viewer. This is only viable in the context of a web page, as the viewer must always be present for a BIRT design to run scripts.
Disabling UI features in a custom web page
Custom web pages can restrict the viewer’s user interface using the actuate.viewer.UIOptions class. For example, if you wanted to create a viewer page that didn’t provide access to parameters, create a UIOptions object that disables the parameters page on the display as shown in the following code:
var manUIOptions = new actuate.viewer.UIOptions( );
manUIOptions.enableParameterPage(false);
To apply this UIConfig settings to the viewer, use the UIConfig object in the viewer’s constructor, as shown in the following code:
var manViewer = new actuate.Viewer(ManContainer);
manViewer.setUIOptions(manUIOptions);
manViewer.submit();
The viewer configured with the parameter page feature disabled does not show the Parameters option in the main menu, as shown in
Figure 13‑8.
Figure 13‑8 The main menu with parameters disabled
Control the viewer interface features with the actuate.viewer.UIOptions class. You create an instance of this class using JavaScript, as shown in the following code:
var uioptions = new actuate.viewer.UIOptions( );
Set the user interface options with the enable functions in the actuate.viewer.UIOptions class. For example, a toolbar appears in the viewer by default, as shown in
Figure 13‑1.
Figure 13‑9 The default toolbar for the JavaScript API viewer
To disable this toolbar, use the following code:
uioptions.enableToolBar(false);
All of the enable functions take a Boolean value as an argument. To configure the viewer to use these options, use setUIOptions( ) as shown in the following code:
viewer.setUIOptions(uioptions);
The setUIOptions( ) function accepts one parameter: an actuate.viewer.UIOptions object. The viewer’s submit( ) function commits the user interface changes to the viewer when the function sends the object to the HTML container. Set the UI options using setUIOptions( ) before you call submit( ).