EasyXLS

Import XLS file in .NET, Java and other programming languages

Concept

EasyXLS™ library allows you to import data from an XLS file or other sheet elements like cell formatting, charts, pivot tables, comments, images and others.

EasyXLS can be successfully used to also import large XLS files having big volume of data with fast importing time.

EasyXLS allows loading an XLS document. Once the XLS is loaded in memory, the user can process data, add more features to the file (like formulas, cell formatting, comments, hyperlinks, images, data validations, page setup, charts, etc), and save the file back in XLS binary format or other format (XLSX, XLSM, XLSB, XML Spreadsheet, XML, TXT, CSV or HTML).
It can be used to load an already formatted XLS file as a template, add data and save back the file in XLS binary format. In this way, a lot of written code that formats the XLS file can be avoided.

EasyXLS permits you to import Excel files without Excel installed, without Interop, without OLEDB or any other additional software installed.

Concept in action

The below example is a common code about how to import an XLS file. The source code shows how to load and import an XLS file that is used as a base template, add more data to the XLS file and save the new workbook.
After that, the best techniques about importing data from XLS file like importing Excel data to DataTable, GridView, DataGridView, DataSet, ResultSet, DataGrid and List are shown.

Source code sample

C#.NET
VB.NET
C++.NET
J#.NET
Java
PHP
ASP
C++
VB6
VBS
Coldfusion

The screen shots below provide an example of the imported XLS file, modified and saved back to another XLS file. The file has two worksheets (First Tab and Second Tab). The data is added to the second worksheet.

Imported XLS file first sheet

   and:

Imported XLS file second sheet

Import data from XLS file

EasyXLS allows you to import data from an Excel sheet or from the active Excel sheet. The entire sheet data or only data from ranges of cells can be imported.

Source code sample

C#.NET
VB.NET
C++.NET
J#.NET
Java
PHP
ASP
C++
VB6
VBS
Coldfusion

Import data from XLS file having one sheet

Importing data from an XLS file, if the XLS file has only one sheet, is the easiest approach. The Excel data can be imported with one single line of code using ExcelDocument.easy_ReadXLSActiveSheet_AsDataSet method.
The above code sample shows how to achieve this goal.

Import data from XLS file having multiple sheets

There are three approaches for importing data from an XLS file with multiple sheets.

I. Usually the first sheet is the active sheet inside an XLS file. If this is your case or if you are importing data from another active sheet use ExcelDocument.easy_ReadXLSActiveSheet_AsDataSet method.

II. For importing data from an Excel sheet and the name of the sheet is known, EasyXLS recommends the use of ExcelDocument.easy_ReadXLSSheet_AsDataSet method.

III. For importing data from an Excel sheet and the name of the sheet is not known, the first step is to find the sheet by reading the XLS file using ExcelDocument.easy_LoadXLSFile method.
Then, import the sheet data using ExcelDocument.easy_ReadExcelWorksheet_AsDataSet method.

Import data from range of Excel cells

EasyXLS enables you to import Excel data either from the entire sheet or from ranges of cells. Importing only a range of cells is a very useful option especially for large XLS files because it reduces the speed of the import process.

In order to import multiple cell ranges at once from Excel sheet, the range parameter must be passed to the method as union of ranges (multiple ranges separated by comma).

All the methods that allow importing XLS file to DataSet or ResultSet have parameters that permit importing only ranges of cells.

Import all XLS file structures

EasyXLS allows you to import the whole XLS file with sheets, data inside sheets, formulas, cell formatting, comments, hyperlinks, images, data validation, page setup, macros, groups, filters, charts, pivot tables and pivot charts.

The first above code sample shows how to achieve this goal.

Import XLS file to SQL table in C# and VB.NET

EasyXLS library can be used to import Excel data to database like SQL Server, MySQL, Oracle, MS Access or any other database.

Import XLS file to DataTable in C# and VB.NET

EasyXLS library can be used to import Excel sheets into DataTable. The DataTable can be the used as data source of a GridView, DataGridView, DataGrid or for any other purposes.

Import XLS file to GridView in C# and VB.NET from ASP.NET

EasyXLS library can be used to import Excel data into GridView from ASP.NET web applications.

Import XLS file to DataGridView in C# and VB.NET

EasyXLS library can be used to import Excel data into DataGridView from windows applications and windows forms.

Import XLS file to DataSet in C# and VB.NET

EasyXLS library can be used to import Excel sheets into DataSet from windows applications, ASP.NET pages or console applications.

Import XLS file to ResultSet in Java

EasyXLS library can be used to import Excel sheets into ResultSet from Java applications.

Import XLS file to list

EasyXLS library can be used to import Excel sheets into lists of data.

Import XLS file to DataGrid in C# and VB.NET

EasyXLS library can be used to import Excel data into DataGrid from windows applications and windows forms.

Convert XLS file to XML

EasyXLS library can be used to convert Excel data into XML file and enables you to import Excel data either from the entire sheet or from ranges of cells. The generated XML document structure is described in the EasyXLS.xsd schema file. The Excel data can be converted to XLS file with one single line of code using ExcelDocument.easy_ReadXLSSheet_AsXML method or ExcelDocument.easy_ReadXLSActiveSheet_AsXML method.

Getting started with EasyXLS Excel library

To download the trial version of EasyXLS Excel Library, press the below button:

Download EasyXLS™ Excel Library for .NET and Java

If you already own a license key, you may login and download EasyXLS from your account.



Available for: Professional, Excel Reader
Go to top

EasyXLS Excel libraries:

.NET
.NET Excel Library
full .NET version to import, export or convert Excel files
.NET Excel Writer
.NET version to create and export Excel files
.NET Excel Reader
.NET version to read and import Excel files
-
Java
Java Excel Library
full Java version to import, export or convert Excel files
Java Excel Writer
Java version to create and export Excel files
Java Excel Reader
Java version to read and import Excel files
Download EasyXLS™ Excel Library for .NET and Java

File formats:

MS Excel 97 - 2003
MS Excel 2007 - 2010
MS Excel 2013
MS Excel 2016
MS Excel 2019
XLS XLSX XLSM XLSB
XML HTML CSV TXT