Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
Data represents the world as it is. To make sense of data, we analyze it and gain an understanding of the world. Data turns into information.
There are many ways of performing analysis: putting data into spreadsheets and manipulating it in different ways is one common method. With Aspose.Cells, it is easy to create spreadsheets that take data from a range of external sources and prepare them for analysis.
This article discusses some data import techniques that developers have access to through Aspose.Cells.
When you open an Excel file with Aspose.Cells, all data in the file is automatically imported. Aspose.Cells can also import data from other data sources:
Aspose.Cells provides a class, Workbook, that represents a Microsoft Excel file. The Workbook class contains the collection WorksheetCollection which allows access to each worksheet in the Excel file. A worksheet is represented by the Worksheet class. The Worksheet class provides a Cells collection. Cells collection provides very useful methods for importing data from other data sources. This article explains how these methods can be used.
To import data to a spreadsheet from an array, call the importArray method of the Cells collection. There are many overloaded versions of the importArray method but a typical overload takes the following parameters:
To import data to a spreadsheet from multi-dimensional arrays, call the relevant importArray overload of the Cells collection:
To import data from an ArrayList to worksheets, call the ImportArrayList method of the Cells collection. The ImportArrayList method takes the following parameters:
To import data from a collection of objects to a worksheet containing merged cells, use ImportTableOptions.CheckMergedCells property. If the Excel template has merged cells, set the value of ImportTableOptions.CheckMergedCells property to true. Pass the ImportTableOptions object along with the list of columns/properties to the method to display your desired list of objects. The following code sample demonstrates the use of ImportTableOptions.CheckMergedCells property to import data from Custom Objects to merged cells. Please see the attached source Excel file and the output Excel file for reference.
Aspose.Cells provides a JsonUtility class for processing JSON. JsonUtility class has an ImportData method for importing JSON data. Aspose.Cells also provides a JsonLayoutOptions class that represents the options of JSON layout. The ImportData method accepts JsonLayoutOptions as a parameter. The JsonLayoutOptions class provides the following properties.
The sample code given below demonstrates the use of the JsonUtility and JsonLayoutOptions classes to import JSON data.
Aspose.Cells not only lets its users import data to worksheets from external data sources but also allow them to export worksheet data to an array.
Aspose.Cells provides a class, Workbook, that represents a Microsoft Excel file. The Workbook class contains a WorksheetCollection that allows access to each worksheet in the Excel file. A worksheet is represented by the Worksheet class. The Worksheet class provides a Cells collection.
Data can easily be exported to an Array object using the Cells class' exportArray method.
Spreadsheets stores data as a sequence of rows and columns. Use the exportArray method to export the data from a worksheet to an array. exportArray takes the following parameters to export worksheet data as an Array object:
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.