Click or drag to resize

IWorksheet InsertArray Method ( Object , Int32, Int32)

Imports an array of objects into a worksheet.
Examples
The following code illustrates how to Imports a two-dimensional array of Object into a worksheet with the specified row and column:
<para>//Create worksheet</para><para>Workbook workbook = new Workbook();</para><para>Worksheet worksheet = workbook.Worksheets[0];</para><para>//Initialize the Object Array</para><para>object[,] arrayTwoDimen = new object[3, 2] { { "AND", "OR" }, { "NAND", "XOR" },{ "NOR", "NOT" } };</para><para>//Insert the Object Array to Sheet</para><para>worksheet.InsertArray(arrayTwoDimen, 1, 1);</para><para>//Save to file</para><para>workbook.SaveToFile(InsertArray.xlsx");</para>

Namespace: Spire.Xls.Core
Assembly: Spire.XLS (in Spire.XLS.dll) Version: 15.4.0.0 (15.4.0.5046)
Syntax
int InsertArray(
	Object[,] arrObject,
	int firstRow,
	int firstColumn
)

Parameters

arrObject
Type: System Object
Array to import.
firstRow
Type: System Int32
Row of the first cell where array should be imported.
firstColumn
Type: System Int32
Column of the first cell where array should be imported.

Return Value

Type: Int32
Number of imported rows.
See Also