Class CustomView

Represents a custom view in Microsoft Excel.

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 apply method on it.

see

Workbook.customViews

Hierarchy

  • Base
    • CustomView

Constructors

constructor

  • Parameters

    Returns CustomView

Properties

$type

$type: Type

Static $t

$t: Type = markType(CustomView, 'CustomView')

Static nextHashCode

nextHashCode: number

Accessors

name

  • get name(): string
  • set name(a: string): void
  • Gets or sets the name of the custom view.

    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.

    The name of the custom view.
    throws

    [[ArgumentNullException]] The value assigned is a null or empty.

    throws

    [[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).

    Returns string

  • Gets or sets the name of the custom view.

    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.

    The name of the custom view.

    Parameters

    • a: string

    Returns void

saveHiddenRowsAndColumns

  • get saveHiddenRowsAndColumns(): boolean
  • Gets the value indicating whether hidden row and column settings are saved with the custom view.

    If the value is False, the return value of getHiddenColumns and getHiddenRows will always be null, regardless of the worksheet specified.

    The value indicating whether hidden row and column settings are saved with the custom view.
    see

    getHiddenColumns

    see

    getHiddenRows

    see

    HiddenColumnCollection

    see

    HiddenRowCollection

    Returns boolean

savePrintOptions

  • get savePrintOptions(): boolean
  • Gets the value indicating whether print options are saved with the custom view.

    If the value is False, the return value of getPrintOptions will always be null, regardless of the worksheet specified.

    The value indicating whether print options are saved with the custom view.
    see

    getPrintOptions

    see

    PrintOptions

    Returns boolean

windowOptions

  • Gets the window options for the workbook associated with the custom view.

    Setting properties on the returned windowOptions instance will not change the actual window options of the associated workbook. After setting properties, the apply method of the CustomView will apply them to the workbook.

    The window options for the workbook associated with the custom view..
    see

    Returns CustomViewWindowOptions

Methods

apply

  • apply(): void
  • Applies all options from the custom view to the associated workbook and its worksheets.

    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.

    throws

    [[InvalidOperationException]] The custom view has previously been removed from its associated workbook.

    Returns void

equals

  • equals(other: any): boolean
  • Parameters

    • other: any

    Returns boolean

getDisplayOptions

  • Gets the display options associated with the specified worksheet.

    Setting properties on the returned DisplayOptions instance will not change the actual display of the worksheet. After setting properties, the apply method of the CustomView will apply them to the worksheet.

    throws

    [[ArgumentNullException]] 'worksheet' is null.

    see

    Worksheet.displayOptions

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated display options are to be retrieved.

    • Default value createIfNull: boolean = true

      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.

    Returns CustomViewDisplayOptions

    Null if the worksheet does not belong to the workbook associated with this custom view; otherwise, the display options associated with the worksheet.

getHashCode

  • getHashCode(): number
  • Returns number

getHiddenColumns

  • Gets the hidden columns associated with the specified worksheet.

    Adding columns on the returned HiddenColumnCollection instance will not actually hide columns in the worksheet. After modifying the hidden columns in this collection, the apply method of the CustomView will hide or unhide the columns.

    throws

    [[ArgumentNullException]] 'worksheet' is null.

    see

    RowColumnBase.hidden

    see

    saveHiddenRowsAndColumns

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated hidden columns are to be retrieved.

    • Default value createIfNull: boolean = true

      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 saveHiddenRowsAndColumns is true.

    Returns HiddenColumnCollection

    Null if 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.

getHiddenRows

  • Gets the hidden rows associated with the specified worksheet.

    Adding rows on the returned HiddenRowCollection instance will not actually hide rows in the worksheet. After modifying the hidden rows in this collection, the apply method of the CustomView will hide or unhide the rows.

    throws

    [[ArgumentNullException]] 'worksheet' is null.

    see

    RowColumnBase.hidden

    see

    saveHiddenRowsAndColumns

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated hidden rows are to be retrieved.

    • Default value createIfNull: boolean = true

      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 saveHiddenRowsAndColumns is true.

    Returns HiddenRowCollection

    Null if 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.

getPrintOptions

  • Gets the print options associated with the specified worksheet.

    Setting properties on the returned PrintOptions instance will not change the actual print settings of the worksheet. After setting properties, the apply method of the CustomView will apply them to the worksheet.

    throws

    [[ArgumentNullException]] 'worksheet' is null.

    see

    Worksheet.printOptions

    see

    savePrintOptions

    Parameters

    • worksheet: Worksheet

      The worksheet whose associated print options are to be retrieved.

    • Default value createIfNull: boolean = true

      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 savePrintOptions is true.

    Returns PrintOptions

    Null if 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.

getSheetDisplayOptions

  • Gets the display options associated with the specified sheet.

    Setting properties on the returned DisplayOptionsBase instance will not change the actual display of the sheet. After setting properties, the apply method of the CustomView will apply them to the sheet.

    throws

    [[ArgumentNullException]] 'sheet' is null.

    see

    Worksheet.displayOptions

    see

    Chartsheet.displayOptions

    Parameters

    • sheet: Sheet

      The sheet whose associated display options are to be retrieved.

    • Default value createIfNull: boolean = true

      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 Sheet. Note the options should only have been null if there were no options for the Sheet when the Workbook was loaded.

    Returns DisplayOptionsBase

    Null if the sheet does not belong to the workbook associated with this custom view; otherwise, the display options associated with the worksheet.

getSheetPrintOptions

  • Gets the print options associated with the specified sheet.

    Setting properties on the returned PrintOptionsBase instance will not change the actual print settings of the sheet. After setting properties, the apply method of the CustomView will apply them to the sheet.

    throws

    [[ArgumentNullException]] 'sheet' is null.

    see

    Worksheet.printOptions

    see

    Chartsheet.printOptions

    see

    savePrintOptions

    Parameters

    • sheet: Sheet

      The sheet whose associated print options are to be retrieved.

    • Default value createIfNull: boolean = true

      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 Sheet. Note the options should only have been null if there were no options for the Sheet when the Workbook was loaded. Also this will not allocate the collection unless the savePrintOptions is true.

    Returns PrintOptionsBase

    Null if savePrintOptions is False or if the sheet does not belong to the workbook associated with this custom view; otherwise, the print options associated with the sheet.

memberwiseClone

  • memberwiseClone(): Base
  • Returns Base

Static compare

  • compare(item1: any, item2: any): number
  • Parameters

    • item1: any
    • item2: any

    Returns number

Static compareSimple

  • compareSimple(item1: any, item2: any): number
  • Parameters

    • item1: any
    • item2: any

    Returns number

Static equalsSimple

  • equalsSimple(item1: any, item2: any): boolean
  • Parameters

    • item1: any
    • item2: any

    Returns boolean

Static equalsStatic

  • equalsStatic(a: any, b: any): boolean
  • Parameters

    • a: any
    • b: any

    Returns boolean

Static getArrayOfProperties

  • getArrayOfProperties(obj: any): any[]
  • Parameters

    • obj: any

    Returns any[]

Static getArrayOfValues

  • getArrayOfValues(obj: any): any[]
  • Parameters

    • obj: any

    Returns any[]

Static getHashCodeStatic

  • getHashCodeStatic(obj: any): number
  • Parameters

    • obj: any

    Returns number

Static referenceEquals

  • referenceEquals(a: any, b: any): boolean
  • Parameters

    • a: any
    • b: any

    Returns boolean