[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.ICustomViews.Add

Add Method

Add(string, bool, bool)

Creates a custom view from the current workbook view state.

The custom view captures the current view state of all worksheets in the workbook. If a custom view with the same name already exists, the existing custom view is replaced. A custom view cannot be added while the workbook contains a table or a pivot table.

Declaration
ICustomView Add(string viewName, bool printSettings, bool rowColSettings)
Function Add(viewName As String, printSettings As Boolean, rowColSettings As Boolean) As ICustomView
Parameters
Type Name Description
string viewName

The name of the custom view. Must not be null, empty, or white-space only.

bool printSettings

true to include print settings in the custom view; otherwise, false.

bool rowColSettings

true to include hidden row and column settings, including filter information, in the custom view; otherwise, false.

Returns
Type Description
ICustomView

The newly created custom view.

Examples
ICustomView customView = workbook.CustomViews.Add("PrintView", true, false);
Exceptions
Type Condition
ArgumentException

Thrown when viewName is null, empty, or white-space only, or when the workbook contains a table or a pivot table.