Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface > ImportArray Method : ImportArray(Object[,],Int32,Int32) Method
Two-dimensional array of object.
Row of the first cell where array should be imported.
Column of the first cell where array should be imported.

ImportArray(Object[,],Int32,Int32) Method

Imports data from a two-dimensional array of System.Object into a worksheet.
Syntax
'Declaration
 
Overloads Function ImportArray( _
   ByVal arrObject(,) As Object, _
   ByVal firstRow As Integer, _
   ByVal firstColumn As Integer _
) As Integer
'Usage
 
Dim instance As IWorksheet
Dim arrObject() As Object
Dim firstRow As Integer
Dim firstColumn As Integer
Dim value As Integer
 
value = instance.ImportArray(arrObject, firstRow, firstColumn)

Parameters

arrObject
Two-dimensional array of object.
firstRow
Row of the first cell where array should be imported.
firstColumn
Column of the first cell where array should be imported.

Return Value

Number of imported rows.
Remarks
To know more about ImportArray refer this link
Example
The following code illustrates how to Imports a two-dimensional array of System.Object into a worksheet with the specified row and column.
using Syncfusion.XlsIO;
 
 class Example
 {
   static void Main()
   {
     ExcelEngine excelEngine = new ExcelEngine();
     IApplication application = excelEngine.Excel;
     application.DefaultVersion = ExcelVersion.Excel2013;
     IWorkbook workbook = application.Workbooks.Create(1);
     IWorksheet worksheet = workbook.Worksheets[0];
     
     //Initialize the Object Array
     object[,] arrayTwoDimen = new object[3, 2] { { "AND", "OR" }, { "NAND", "XOR" },{ "NOR", "NOT" } };
            
     //Import the Object Array to Sheet
     worksheet.ImportArray(arrayTwoDimen, 1, 1);
            
     workbook.SaveAs("ImportArray.xlsx");
     workbook.Close();
     excelEngine.Dispose();
   }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also