Forums     Knowledge Base     OfficeWriter Online     
 
This documentation is for
OfficeWriter v3.0.4
.NET Platform

View Docs for Another
Version or Platform

Programmer's Reference > ExcelApplication API > Area > ImportData

ImportData Method



Signature:

public Area ImportData ( Object[,] data , String[] columnNames , DataImportProperties props )

Description:

Imports data from a rectangular 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 rectangular array of values to import to the worksheet. The first dimension corresponds to row and the second to column. Thus, an array of data {{"A","B","C"},{"X","Y",Z"}} would be inserted into the worksheet as:
ABC
XYZ
columnNames     A string array of column names.
props     A DataImportProperties object that contains a set of properties that will determine the behavior of the data import.

Returns:

Area An Area object representing the set of cells populated with the imported values.

Examples:

[csharp]
DataImportProperties importProps = wb.CreateDataImportProperties();
importProps.Transpose = true;
Area importedArea = a.ImportData(dataArray, fieldNames, importProps);
[vbnet]
Dim importProps As DataImportProperties = wb.CreateDataImportProperties()
importProps.Transpose = True
Dim importedArea As Area = a.ImportData(dataArray, fieldNames, importProps)



Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.