Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface > ImportArray Method : ImportArray(DateTime[],Int32,Int32,Boolean) Method
Array of datetime value.
Row of the first cell where array should be imported.
Column of the first cell where array should be imported.
True if array should be imported vertically; False - horizontally.

ImportArray(DateTime[],Int32,Int32,Boolean) Method

Imports an array of System.DateTime values into a worksheet.
Syntax
'Declaration
 
Overloads Function ImportArray( _
   ByVal arrDateTime() As Date, _
   ByVal firstRow As Integer, _
   ByVal firstColumn As Integer, _
   ByVal isVertical As Boolean _
) As Integer
'Usage
 
Dim instance As IWorksheet
Dim arrDateTime() As Date
Dim firstRow As Integer
Dim firstColumn As Integer
Dim isVertical As Boolean
Dim value As Integer
 
value = instance.ImportArray(arrDateTime, firstRow, firstColumn, isVertical)

Parameters

arrDateTime
Array of datetime value.
firstRow
Row of the first cell where array should be imported.
firstColumn
Column of the first cell where array should be imported.
isVertical
True if array should be imported vertically; False - horizontally.

Return Value

Number of imported elements.
Remarks
To know more about ImportArray refer this link
Example
The following code illustrates how to Imports an array of System.DateTime values into a worksheet with the specified row and column.
using Syncfusion.XlsIO;
 using System;
 
 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 DateTime Array
     DateTime[] arrayDate = new DateTime[4] { DateTime.Parse("06:45"), DateTime.Parse("08:30"), DateTime.Parse("09:40"), DateTime.Parse("10:30") };
            
     //Import the DateTime Array to Sheet
     worksheet.ImportArray(arrayDate, 1, 1, true);
            
     workbook.SaveAs("ImportArray.xlsx");
     workbook.Close();
     excelEngine.Dispose();
   }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also