ig.excel.CustomView
Remarks
Custom views provide a way to save display options and optionally print options for the workbook and each worksheet in the workbook. These options can be different from the options currently set on the workbook and worksheets.
Multiple custom views can be saved with a workbook, and the options from a custom view can be applied to its associated workbook by calling the CustomView.apply method on it.
Dependencies
-
apply
- .apply( );
Applies all options from the custom view to the associated workbook and its worksheets.
Exceptions
Exception Description ig.InvalidOperationException The custom view has previously been removed from its associated workbook. Remarks
There is no state of the workbook indicating the custom view currently applied, so applying a custom view simply copies over all options saved with it to the workbook and its worksheet. If an applied custom view is then changed, those changes will not be updated on the workbook or worksheets. Instead, the custom view will need to be applied again for those changes to be reflected on the workbook or worksheet.
-
getDisplayOptions
- .getDisplayOptions( worksheet:ig.excel.Worksheet, [createIfNull:boolean] );
- Return Type:
- ig.excel.CustomViewDisplayOptions
- Return Type Description:
- Null if the worksheet does not belong to the workbook associated with this custom view; otherwise, the display options associated with the worksheet.
Gets the display options associated with the specified worksheet.
- worksheet
- Type:ig.excel.Worksheet
- The worksheet whose associated display options are to be retrieved.
- createIfNull
- Type:boolean
- Optional
- True to create the display options if it has not yet been allocated. The options will be initialized based on the current state of the Worksheet. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded.
Exceptions
Exception Description ig.ArgumentNullException worksheet is null. Remarks
Setting properties on the returned DisplayOptions instance will not change the actual display of the worksheet. After setting properties, the CustomView.apply method of the CustomView will apply them to the worksheet.
See Also
-
getHiddenColumns
- .getHiddenColumns( worksheet:ig.excel.Worksheet, [createIfNull:boolean] );
- Return Type:
- ig.excel.HiddenColumnCollection
- Return Type Description:
- Null if CustomView.saveHiddenRowsAndColumns is False or if the worksheet does not belong to the workbook associated with this custom view; otherwise, the collection of hidden columns associated with the worksheet.
Gets the hidden columns associated with the specified worksheet.
- worksheet
- Type:ig.excel.Worksheet
- The worksheet whose associated hidden columns are to be retrieved.
- createIfNull
- Type:boolean
- Optional
- True to create the hidden column if it has not yet been allocated of the Worksheet. The options will be initialized based on the current state. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded. Also this will not allocate the collection unless the CustomView.saveHiddenRowsAndColumns is true.
Exceptions
Exception Description ig.ArgumentNullException worksheet is null. Remarks
Adding columns on the returned HiddenColumnCollection instance will not actually hide columns in the worksheet. After modifying the hidden columns in this collection, the CustomView.apply method of the CustomView will hide or unhide the columns.
-
getHiddenRows
- .getHiddenRows( worksheet:ig.excel.Worksheet, [createIfNull:boolean] );
- Return Type:
- ig.excel.HiddenRowCollection
- Return Type Description:
- Null if CustomView.saveHiddenRowsAndColumns is False or if the worksheet does not belong to the workbook associated with this custom view; otherwise, the collection of hidden rows associated with the worksheet.
Gets the hidden rows associated with the specified worksheet.
- worksheet
- Type:ig.excel.Worksheet
- The worksheet whose associated hidden rows are to be retrieved.
- createIfNull
- Type:boolean
- Optional
- True to create the hidden column if it has not yet been allocated. The options will be initialized based on the current state of the Worksheet. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded. Also this will not allocate the collection unless the CustomView.saveHiddenRowsAndColumns is true.
Exceptions
Exception Description ig.ArgumentNullException worksheet is null. Remarks
Adding rows on the returned HiddenRowCollection instance will not actually hide rows in the worksheet. After modifying the hidden rows in this collection, the CustomView.apply method of the CustomView will hide or unhide the rows.
-
getPrintOptions
- .getPrintOptions( worksheet:ig.excel.Worksheet, [createIfNull:boolean] );
- Return Type:
- ig.excel.PrintOptions
- Return Type Description:
- Null if CustomView.savePrintOptions is False or if the worksheet does not belong to the workbook associated with this custom view; otherwise, the print options associated with the worksheet.
Gets the print options associated with the specified worksheet.
- worksheet
- Type:ig.excel.Worksheet
- The worksheet whose associated print options are to be retrieved.
- createIfNull
- Type:boolean
- Optional
- True to create the print options if it has not yet been allocated. The options will be initialized based on the current state of the Worksheet. Note the options should only have been null if there were no options for the Worksheet when the Workbook was loaded. Also this will not allocate the collection unless the CustomView.savePrintOptions is true.
Exceptions
Exception Description ig.ArgumentNullException worksheet is null. Remarks
Setting properties on the returned PrintOptions instance will not change the actual print settings of the worksheet. After setting properties, the CustomView.apply method of the CustomView will apply them to the worksheet.
-
name
- .name( );
- Return Type:
- string
- Return Type Description:
- The name of the custom view.
Gets the name of the custom view.
Exceptions
Exception Description ig.ArgumentNullException The value assigned is a null or empty. ig.ArgumentException The value assigned is the name of another custom view in this custom view's associated workbook (custom view names are compared case-insensitively). Remarks
The name of the custom view is displayed in the custom views dialog of Microsoft Excel and must be case-insensitively unique to other custom views in the workbook.
-
name
- .name( value:string );
- Return Type:
- string
- Return Type Description:
- The name of the custom view.
Sets the name of the custom view.
- value
- Type:string
Exceptions
Exception Description ig.ArgumentNullException The value assigned is a null or empty. ig.ArgumentException The value assigned is the name of another custom view in this custom view's associated workbook (custom view names are compared case-insensitively). Remarks
The name of the custom view is displayed in the custom views dialog of Microsoft Excel and must be case-insensitively unique to other custom views in the workbook.
-
saveHiddenRowsAndColumns
- .saveHiddenRowsAndColumns( );
- Return Type:
- boolean
- Return Type Description:
- The value indicating whether hidden row and column settings are saved with the custom view.
Gets the value indicating whether hidden row and column settings are saved with the custom view.
Remarks
If the value is False, the return value of CustomView.getHiddenColumns and CustomView.getHiddenRows will always be null, regardless of the worksheet specified.
-
savePrintOptions
- .savePrintOptions( );
- Return Type:
- boolean
- Return Type Description:
- The value indicating whether print options are saved with the custom view.
Gets the value indicating whether print options are saved with the custom view.
Remarks
If the value is False, the return value of CustomView.getPrintOptions will always be null, regardless of the worksheet specified.
-
windowOptions
- .windowOptions( );
- Return Type:
- ig.excel.CustomViewWindowOptions
- Return Type Description:
- The window options for the workbook associated with the custom view..
Gets the window options for the workbook associated with the custom view.
Remarks
Setting properties on the returned CustomView.windowOptions instance will not change the actual window options of the associated workbook. After setting properties, the CustomView.apply method of the CustomView will apply them to the workbook.