Class WorkbooksCollection
A collection of all the Workbook objects that are currently open in the XlsIO application.
Implements
Inherited Members
Namespace: Syncfusion.XlsIO.Implementation.Collections
Assembly: Syncfusion.XlsIO.NET.dll
Syntax
public class WorkbooksCollection : CollectionBaseEx<IWorkbook>, IList<IWorkbook>, ICollection<IWorkbook>, IParentApplication, ICloneParent, IWorkbooks, IEnumerable<IWorkbook>, IEnumerable
Constructors
WorkbooksCollection(IApplication, Object)
Creates workbook and sets its Application and Parent properties.
Declaration
public WorkbooksCollection(IApplication application, object parent)
Parameters
Type | Name | Description |
---|---|---|
IApplication | application | Application object for the collection. |
System.Object | parent | Parent object for the collection. |
Properties
Item[Int32]
Returns a single object from a collection.
Declaration
public IWorkbook this[int Index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | Index |
Property Value
Type |
---|
IWorkbook |
Methods
Close()
Closes the object.
Declaration
public void Close()
Create()
Create new empty workbook and make it active.
Declaration
public IWorkbook Create()
Returns
Type | Description |
---|---|
IWorkbook | Interface on instance of newly created workbook. |
Create(Int32)
Create workbook with specified number of empty worksheets.
Declaration
public IWorkbook Create(int sheetsQuantity)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | sheetsQuantity | Number of worksheets to create. |
Returns
Type | Description |
---|---|
IWorkbook | Interface on instance of created workbook. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | When sheetsQuantity is less than zero. |
Create(String[])
Create workbook with names.Length quantity of worksheets. Each worksheet name will be set to corresponding names array element.
Declaration
public IWorkbook Create(string[] names)
Parameters
Type | Name | Description |
---|---|---|
System.String[] | names | Array of names for each worksheet. |
Returns
Type | Description |
---|---|
IWorkbook | Interface on instance of created workbook. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | When names array is NULL. |
System.ArgumentException | When names does not contain any value. |
Open(Stream)
Read workbook from the stream.
Declaration
public IWorkbook Open(Stream stream)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
Returns
Type | Description |
---|---|
IWorkbook | Newly created workbook. |
Open(Stream, ExcelOpenType)
Opens a workbook.
Declaration
public IWorkbook Open(Stream stream, ExcelOpenType openType)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
ExcelOpenType | openType | Represents type of the file for open operation. |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook. |
Open(Stream, ExcelOpenType, ExcelParseOptions)
Opens a workbook.
Declaration
public IWorkbook Open(Stream stream, ExcelOpenType openType, ExcelParseOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
ExcelOpenType | openType | Represents type of the file for open operation. |
ExcelParseOptions | options |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook. |
Open(Stream, ExcelOpenType, ExcelVersion)
Opens a workbook.
Declaration
public IWorkbook Open(Stream stream, ExcelOpenType openType, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
ExcelOpenType | openType | Represents type of the file for open operation. |
ExcelVersion | version |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook. |
Open(Stream, ExcelParseOptions)
Read workbook from the stream.
Declaration
public IWorkbook Open(Stream stream, ExcelParseOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
ExcelParseOptions | options | Parse options. |
Returns
Type | Description |
---|---|
IWorkbook | Newly created workbook. |
Open(Stream, ExcelParseOptions, Boolean, String)
Opens the specified stream.
Declaration
public IWorkbook Open(Stream stream, ExcelParseOptions options, bool isReadOnly, string password)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
ExcelParseOptions | options | Parse options. |
System.Boolean | isReadOnly | Indicates is open book in read - only mode. |
System.String | password | Represents valid password for opening workbook. |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook. |
Open(Stream, ExcelParseOptions, Boolean, String, ExcelOpenType)
Opens the specified stream.
Declaration
public IWorkbook Open(Stream stream, ExcelParseOptions options, bool isReadOnly, string password, ExcelOpenType openType)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
ExcelParseOptions | options | Parse options. |
System.Boolean | isReadOnly | Indicates is open book in read - only mode. |
System.String | password | Represents valid password for opening workbook. |
ExcelOpenType | openType | Represents type of the file for open operation. |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook. |
Open(Stream, ExcelParseOptions, Boolean, String, ExcelVersion)
Opens the specified stream.
Declaration
public IWorkbook Open(Stream stream, ExcelParseOptions options, bool isReadOnly, string password, ExcelVersion excelVersion)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | The stream. |
ExcelParseOptions | options | Parse options. |
System.Boolean | isReadOnly | Indicates is open book in read - only mode. |
System.String | password | Represents valid password for opening workbook. |
ExcelVersion | excelVersion |
Returns
Type | Description |
---|---|
IWorkbook | Opened workbook. |
Open(Stream, ExcelVersion)
Read workbook from the stream.
Declaration
public IWorkbook Open(Stream stream, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
ExcelVersion | version | Version of the excel file format. |
Returns
Type | Description |
---|---|
IWorkbook | Newly created workbook. |
Open(Stream, ExcelVersion, ExcelParseOptions)
Read workbook from the stream.
Declaration
public IWorkbook Open(Stream stream, ExcelVersion version, ExcelParseOptions options)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream with workbook's data. |
ExcelVersion | version | Version of the excel file format. |
ExcelParseOptions | options |
Returns
Type | Description |
---|---|
IWorkbook | Newly created workbook. |
Open(Stream, String)
Opens a Workbook using separator.
Declaration
public IWorkbook Open(Stream stream, string separator)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to open. |
System.String | separator | Denotes separator for the CSV file types. |
Returns
Type | Description |
---|---|
IWorkbook | Opened WorkBook. |
Open(Stream, String, ExcelVersion)
Opens a Workbook using separator.
Declaration
public IWorkbook Open(Stream stream, string separator, ExcelVersion version)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to open. |
System.String | separator | Denotes separator for the CSV file types. |
ExcelVersion | version |
Returns
Type | Description |
---|---|
IWorkbook | Opened WorkBook. |
Open(Stream, String, Int32, Int32)
Opens a Workbook using separator.
Declaration
public IWorkbook Open(Stream stream, string separator, int row, int column)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to open. |
System.String | separator | Denotes separator for the CSV file types. |
System.Int32 | row | Number of first row to write. |
System.Int32 | column | Number of first column to write. |
Returns
Type | Description |
---|---|
IWorkbook | Opened WorkBook. |
Open(Stream, String, Int32, Int32, Encoding)
Opens a Workbook using separator.
Declaration
public IWorkbook Open(Stream stream, string separator, int row, int column, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to open. |
System.String | separator | Denotes separator for the CSV file types. |
System.Int32 | row | Number of first row to write. |
System.Int32 | column | Number of first column to write. |
System.Text.Encoding | encoding | Encoding to use to parse text data. |
Returns
Type | Description |
---|---|
IWorkbook | Opened WorkBook. |
Open(Stream, String, Encoding)
Opens a Workbook using separator.
Declaration
public IWorkbook Open(Stream stream, string separator, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to open. |
System.String | separator | Denotes separator for the CSV file types. |
System.Text.Encoding | encoding | Encoding to use to parse text data. |
Returns
Type | Description |
---|---|
IWorkbook | Opened WorkBook. |
Open(Stream, Encoding)
Opens a Workbook using default separator.
Declaration
public IWorkbook Open(Stream stream, Encoding encoding)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Stream to open. |
System.Text.Encoding | encoding | Encoding to use to parse text data. |
Returns
Type | Description |
---|---|
IWorkbook | Opened WorkBook. |
OpenFromXml(Stream, ExcelXmlOpenType)
Read workbook from xml file.
Declaration
public IWorkbook OpenFromXml(Stream stream, ExcelXmlOpenType openType)
Parameters
Type | Name | Description |
---|---|---|
System.IO.Stream | stream | Path to xml file. |
ExcelXmlOpenType | openType | Xml open type. |
Returns
Type | Description |
---|---|
IWorkbook | Returns opened workbook. |
OpenFromXml(XmlReader, ExcelXmlOpenType)
Read workbook from xml stream.
Declaration
public IWorkbook OpenFromXml(XmlReader reader, ExcelXmlOpenType openType)
Parameters
Type | Name | Description |
---|---|---|
System.Xml.XmlReader | reader | Xml reader. |
ExcelXmlOpenType | openType | Xml open type. |
Returns
Type | Description |
---|---|
IWorkbook | Returns opened workbook. |