Syncfusion.XlsIO.Base
Example 


Syncfusion.XlsIO Namespace > IWorksheet Interface > ImportArray Method : ImportArray(String[],Int32,Int32,Boolean) Method
Array of string 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(String[],Int32,Int32,Boolean) Method

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

Parameters

arrString
Array of string 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.String values 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 string Array
     string[] arrayString = new string[4] { "Total Income", "Actual Expense", "Expected Expenses", "Profit" };
            
     //Import the string Array to Sheet
     worksheet.ImportArray(arrayString, 1, 1, true);
            
     workbook.SaveAs("ImportArray.xlsx");
     workbook.Close();
     excelEngine.Dispose();
   }
}
AssemblyVersion

Syncfusion.XlsIO.Base: 16.4460.0.40

See Also