|
Programmer's Reference >
ExcelApplication API >
Area > ImportData
ImportData Method
Signature:
public Area ImportData ( Object[][] data
, String[] columnNames
, DataImportProperties properties
)
Description:
Imports data from a two-dimensional array of objects to the specified Area . The new data will overwrite values and formulas in the target worksheet cells, but existing formatting will be preserved.
Parameters:
|
data |
A two-dimensional array of values to import to the worksheet. By default, the first dimension corresponds to column and the second to row (that is, Object[column][row]). Thus, an array of data {{"A","B","C"},{"X","Y",Z"}} would be inserted into the worksheet as: If you enable DataImportProperties.setTranspose , the format will be [row][column] and the same array would be inserted as:
|
|
columnNames |
An array of column names for the imported data. columnNames and the column dimension of data must contain the same number of elements. |
|
properties |
A DataImportProperties object that contains a set of properties to use when importing data to the area. |
Returns:
Area
An Area object representing the set of cells populated with the imported values.
Examples:
[csharp]
DataImportProperties importProps = oWorkbook.CreateDataImportProperties();
importProps.Truncate = true;
Area importedArea = a.ImportData(dataArray, fieldNames, importProps);
[vbnet]
Dim importProps As DataImportProperties = wb.CreateDataImportProperties()
importProps.Truncate = True
Dim importedArea As Area = a.ImportData(dataArray, fieldNames, importProps)
Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.
|
|
|