EasyXLS

Tips for exporting large Excel file in .NET, Java and other programming languages

Concept

EasyXLS™ library allows you to export large data to Excel file with fast exporting time. The supported Excel file formats are XLSX, XLSM, XLSB, XLS and XML Spreadsheet, CSV, TXT, HTML as text files.

If not familiar with EasyXLS Excel library, read first how to export data to Excel file in .NET, how to export data to Excel file in Java and how to export data in PHP and Classic ASP.

Concept in action

The below 7 tips will guide you to export large Excel files.

1. Cell formatting

Use as much as possible ExcelStyle class when formatting cells. Setting the format properties for each cell increases the amount of used memory, affecting the performance when exporting large Excel files. It is recommended to create ExcelStyle objects to set the formatting style for cells.

Source code sample

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

2. Formatting style and themes

Do not create multiple instances of the same style or the same theme inside a loop. Define the instance of the style or theme outside the loop.

Source code sample

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

3. Data type of the cells

When setting the cell value, it is recommended to set the cell data type as well, otherwise the data type will remain by default as DataType.AUTOMATIC and EasyXLS will try to detect it. This action can be time consuming.


4. Recommended file formats

XLSB and XLS file formats are binary files and therefore are faster by default. EasyXLS recommends to use these file formats for better performances.


5. Formula calculation

Setting the formula calculation flag to false is recommended in case that calculating the formulas is not needed when writing the Excel files because, anyway, Microsoft Excel is recalculating them by default when opening the Excel files.
By applying this option, the formulas will no longer be computed and time-computing will be gained.


6. Java memory heap

When using Java programming language, it is recommended to add an extra parameter when running your application. JRE uses 64M of memory by default and your computer performances don't count. You need to increase the memory heap size by using -mx option (run your application using "java -mx512m").


Available for: Professional, Excel Writer
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
XLSXXLSMXLSBXLS
XMLHTMLCSVTXT