export DataGridView to Excel in .NETHave you ever had a WinForm that shows a nice report inside a DataGridView? It looks great! Now, you want to export this report to Excel and you’re asking yourself, “How can I do this?”. You have the button that it says “Export to Excel”, but now “What should I do?”. If this is your case, you are now on the right page. If you have never confronted with this situation, who knows, maybe tomorrow will surprise you and you can be ready from now on. See..you’re still on the right page.

EasyXLS Excel library makes such tasks so much easier to achieve. When it comes to export data to Excel, EasyXLS is the best choice. It offers all kind of methods and solutions that make complicated things uncomplicated when Excel files are involved.

Now, let’s get back to our DataGridView and “Export to Excel” button. Using EasyXLS, you can export DataGridView to XLSX, XLS, XLSM or XLSB file formats. The Excel file can also have multiple sheets and you can choose the right sheet where the DataGridView can fit. Do you have a huge DataGridView? EasyXLS handles very well exporting large data to Excel. If I have captured your attention, see here how to export DataGridView to Excel in C# and VB.NET.

In most of the cases the data source of the DataGridView is a DataTable. If so, have you ever thought that the export to Excel can be done with one line of code? Check this sample on exporting DataTable to Excel file in C# and VB.NET.

Now get your keyboard back to work. Happy coding!

(0) Comments    Read More   
Oct
07

Export list to ExcelEasyXLS is an Excel library and component that allows you to export lists of data to Excel files. The list can contain strings, dates, number or any other objects. The list can be exported to XLSX, XLS, XLSM or XLSB file formats.

Export list to Excel in C#
The list can be a System.Collections.ArrayList object, System.Collections.Generic.List or any other structure that implements a list.

Export list to Excel in VB.NET
The same as previously mentioned lists can be exported from VB.NET.

Export list to Excel from ASP.NET
EasyXLS can be successfully integrated in ASP.NET web applications, including ASP.NET MVC applications.

Export list to Excel in PHP
EasyXLS can be used to export list items to Excel in PHP. The list can also contain data from MySQL databases.

Export list to Excel in Java
The list can be a java.util.ArrayList object, java.util.Vector or any other structure that implements a list.

Export list to Excel in C++
EasyXLS can also be used from C++ to export data from lists to Excel file. COM+ objects and methods make possible the integration of the .NET component in C++. The Excel component can be also integrated in MFC applications.

For more details and how to do it read export list to Excel.

Best way to export List to Excel file in C#, VB.NET, Java, PHP and many other!

(0) Comments    Read More   
Sep
08

export data to xls fileEasyXLS is an Excel component that facilitates the export of real XLS files from C#, VB.NET, Java, C++, PHP or ASP classic.

It is a common practice to save HTML files with XLS extension to export reports as Excel. But sometimes you need real XLS binary files for having access to full Excel feature, not only cell data and cell formatting. If your Excel file must include autofilters, pivot tables, conditional formatting, macros or charts, EasyXLS Excel component is the best solution and offers all of these features and even more. Your Excel file can also have multiple sheets.

Using EasyXLS, you can export a GridView, DataGridView, DataGrid, DataTable, DataSet, JTable or ResultSet data structures to Excel with one single line of code.

The exported data can be arranged in predefined or custom formats and if necessary, the data can be protected from unintentional editing actions or secured with passwords.

Furthermore, EasyXLS component handles very well big volume of data. Large Excel files can be exported with less memory consumption and at a reasonable speed.

EasyXLS also includes a calculation engine, that allows not only to add formulas to your Excel, but also to calculate them, if necessary.

Read more details on how to export data to xls file in C#, VB.NET, Java, C++, PHP.

(0) Comments    Read More   

Export data to XLSX file in .NET or JavaEasyXLS Excel library makes easier the export of Excel reports in XLSX file format.

The Excel reports can be formatted to have an attractive look, exactly in the preferred mode, or one of the predefined looks can be selected.

The Excel library works without Excel installed and without Interop and it is perfect to be used from server environments or desktop applications.

Data structures like GridView, DataGridView, DataGrid, DataTable, DataSet, JTable and ResultSet can be exported to XLSX file with one single line of code.

EasyXLS can be used from programming languages like C#, VB.NET, C++.NET, J#, Java, PHP, ASP classic, C++, VB6, VBS or ColdFusion.

EasyXLS allows not only the export of data and formatting, but also offers other Excel features like conditional formatting, data validation, comments, images and print options.

Moreover, the data can be exported as charts, pivot tables or pivot charts.

The data can be protected with password and the Excel file can be encrypted.

The export of XLSX file is fast, so it is the best solution for exporting large xlsx files.

Read more details on how to export data to xlsx file in C#, VB.NET, Java, C++, PHP.

(0) Comments    Read More   

Nice formatted reports
EasyXLS can be used to create nice formatted Excel reports. The exported reports can be in XLSX, XLS, XLSM or XLSB file format.

export data to excel with formatting

EasyXLS Excel library can be integrated in various programming languages like C#, VB.NET, C++.NET, Java, PHP, ASP classic or C++ or more. The library can be included in any environment that supports .NET, Java or COM technology.

Predefined formats
The report can have a predefined look or a custom formatting. EasyXLS comes with 50 predefined auto formats. Also, custom color and font schemes can be set for report appearance. Themes of colors can be applied for Office 2007-2013 documents.

Data protection
The data in cells can be protected from unintended editing, if data must keep its integrity. Excel file can also be protected with password when the file is opened or modified. EasyXLS also support encrypted Excel files.

Full support
EasyXLS supports all formatting settings that Microsoft Excel offers for spreadsheet design like number and date format, text alignment, font settings, border settings, fill settings (background, pattern gradient) and cell protection.

Read more about how to format Excel cells, Excel rows or Excel columns. Code samples and more technical details can be found at this link.

(0) Comments    Read More   
Jul
30
Posted on 30-07-2014
Filed Under (ASP.NET, C#, Export, GridView, VB.NET) by Oana

export gridview to excel in asp.netExporting GridView to Excel file is a common task for almost all ASP.NET applications that involves displaying reports of data to users. Usually the report from the screen must be exported to different file formats. The Excel file formats, like XLS, XLSX, XLSM and XLSB, are some of them.

EasyXLS Excel library lets you export the GridView in a very simple and fast way and it allows you to format the report according to requirements.

The library can be integrated in ASP.NET web applications and can be used from C#, VB.NET or C++.NET.

The exported Excel file can have multiple sheets and each of them can contain another GridView, if necessary, or additional data.

EasyXLS allows you to export the GridView and the Excel file will have a similar look like your screen report. The library offers all the formatting features for the Excel cells including background, foreground, borders and alignment options. The data from the Excel cells can be locked from unintentional editing events. Even more, the exported Excel file can be password secured when the file is opened or edited.

EasyXLS handles very well big volume of data and it works without Excel installed and without OLE Automation.

Check here some source code samples:
Export GridView to Excel in C#
Export GridView to Excel in VB.NET

(0) Comments    Read More   
Jun
27
Posted on 27-06-2014
Filed Under (Export, Java, ResultSet, SQL, XLS, XLSB, XLSX) by Oana

export ResultSet to Excel in JavaEasyXLS is a Java Excel library that offers direct methods that allow exporting a ResultSet to Excel file in Java.
The export methods are easy to use and the task can be performed even in one single line of code.


Export SQL data to Excel using Java
EasyXLS makes it simple to extract data from database and export data to Excel in XLS, XLSX, XLSM or XLSB file formats. The data can be exported to nice formatted Excel reports. EasyXLS component allows you to export data from any database, including MS SQL Server or MySQL.

Export ResultSet to Open XML file format
EasyXLS supports Open XML file format and allows the export of XLSX files. It also supports XLSM and XLSB files.

Export ResultSet to Excel 97, Excel 2013, Excel 2007, Excel 2010, Excel 2013
EasyXLS supports all MS Excel 97-2013 file formats: XLS, XLSX, XLSM and XLSB. It also supports text file formats like XML Spreadsheet, CSV, TXT and HTML.

EasyXLS Java Excel library integration
EasyXLS Excel library can be integrated in any Java applications, applets, servlets or JSP pages or programming languages that permit Java development like ColdFusion.

Check out this code sample on how to easily export ResultSet to Excel in Java!

(0) Comments    Read More   

It’s never been easier. EasyXLS Excel library provides methods for exporting the DataSet to Excel with one single line of code.
See more details and code samples about how to export DataSet to Excel in C# and VB.NET.

Export SQL data to Excel using C# or VB.NET
EasyXLS makes it easy to take out data from database and export data to Excel in XLS and XLSX file formats. The data can be arranged in nice formatted reports. The component allows you to export data from any database, including MS SQL Server or MySQL.

Export to Excel in ASP.NET from DataSet
EasyXLS component can be used from ASP.NET web applications. If the data is displayed in a GridView, see export GridView to Excel in ASP.NET.

Export data from DataSet to Excel in C# and VB.NET from windows application
EasyXLS component can also be used from WinForms and windows applications. If data is displayed in a DataGridView, see how to export DataGridView to Excel in C#.

Export DataSet to Excel Open XML
EasyXLS supports Open XML file format and allows the export of XLSX files. It also supports XLSM and XLSB files.

Export DataSet to Excel 2003
EasyXLS supports Excel 2003 file format and allows the export of XLS files. It also supports XML Spreadsheet, CSV, TXT and HTML files.

ALL WITHOUT MS Excel installed, WITHOUT Interop!

(0) Comments    Read More   

EasyXLS Excel library is your key!

The DataTable can be the result of a SQL query or the data source for a GridView, DataGridView and DataGrid.

Export SQL query to Excel file
The result of a SQL query can be instantly exported to Excel with one line of code using EasyXLS Excel library. See more details about how to export DataSet to Excel.

Export GridView to Excel file
If the data source of the GridView is a DataTable and the intention is to export simply the data contained by the DataTable, see more details about how to export DataTable to Excel. If you want to export also the GridView formatting to Excel, check how to export GridView to Excel.

Export DataGridView to Excel file
If the data source of the DataGridView is a DataTable and the intention is to export simply the data contained by the DataTable, see more details about how to export DataTable to Excel. If you want to export also the DataGridView formatting to Excel, check how to export DataGridView to Excel.

Export DataGrid to Excel file
If the data source of the DataGrid is a DataTable and the intention is to export simply the data contained by the DataTable, see more details about how to export DataTable to Excel. If you want to export also the DataGrid formatting to Excel, check how to export DataGrid to Excel.

(0) Comments    Read More   
Apr
09
Posted on 09-04-2012
Filed Under (EasyXLS, Export, Features, Write) by Daniela

In this article, I will focus on the export feature of EasyXLS component.

The component lets you export any Microsoft Excel file format like XLS, XLSX, XLSB, CSV, TXT, XML and even HTML files.

Microsoft Excel is not required to be installed on the machine that runs EasyXLS library, so you can save lots of money on the Microsoft Office server license you will be avoiding the nightmares caused by OLE Automation (OLE/ADO). The resources used are minimal, reducing the server load.

EasyXLS for .NET is compatible with any .NET programming language: C#, VB.NET, J#, C++.NET. It also includes a COM+ extension that widens the compatibility to include ASP, PHP, C++, VB6, VBS or any other language that supports COM technology. The only requirement is the installation of .NET Framework 1.1 or later, which is free and lately comes preinstalled in Windows operating system..

EasyXLS for Java is designed to cover all non Windows operating systems like Linux, MacOS, HP-UX, Solaris and others. JRE 1.4 or later installation is required.

I am posting a piece of code to show how easy it is to export an XLS file and get a nice look for your report. I chose C# as programming language. This sample extracts the data from a SQL database and generates an Excel file based on the dataset. The XLS file is generated in one line of code.


using System;
using System.Data;
using EasyXLS;
using EasyXLS.Constants;

public class Tutorial1
{
[STAThread]
static void Main()
{
Console.WriteLine("Tutorial 1\n-----------\n");

// Create an instance of the object that generates Excel files
ExcelDocument xls = new ExcelDocument();

// Create the database connection
String sConnectionString = "Initial Catalog=Northwind;Data Source=localhost;Integrated Security=SSPI;";
System.Data.SqlClient.SqlConnection sqlConnection = new System.Data.SqlClient.SqlConnection(sConnectionString);
sqlConnection.Open();

// Create the adapter used to fill the dataset
String sQueryString = "SELECT TOP 100 CAST(Month(ord.OrderDate) AS varchar)+'/' + CAST(Day(ord.OrderDate) AS varchar) + '/' + CAST(year(ord.OrderDate) AS varchar) AS 'Order Date', " +
" P.ProductName AS 'Product Name', O.UnitPrice AS Price, O.Quantity , O.UnitPrice * O. Quantity AS Value" +
" FROM Orders AS ord, [Order Details] AS O, Products AS P WHERE O.ProductID = P.ProductID AND O.OrderID = ord.OrderID";
System.Data.SqlClient.SqlDataAdapter adp = new System.Data.SqlClient.SqlDataAdapter(sQueryString, sqlConnection);

// Populate the dataset
DataSet ds = new DataSet();
adp.Fill(ds);

// Generate the file
Console.WriteLine("Writing file C:\\Samples\\Tutorial1.xls.");
xls.easy_WriteXLSFile_FromDataSet("c:\\Samples\\Tutorial1.xls", ds, new ExcelAutoFormat(Styles.AUTOFORMAT_EASYXLS1), "Sheet1");

// Confirm generation
String sError = xls.easy_getError();
if (sError.Equals(""))
Console.Write("\nFile successfully created. Press Enter to Exit...");
else
Console.Write("\nError encountered: " + sError + "\nPress Enter to Exit...");

// Close the database connection.
sqlConnection.Close();

// Dispose memory
xls.Dispose();
ds.Dispose();
sqlConnection.Dispose();
adp.Dispose();

Console.ReadLine();
}
}

Of course, you can export any other type of data; its source doesn’t have to be from a database. EasyXLS covers most of the features supported by Microsoft Excel. You can add hyperlinks, comments, images, charts and many more.

The next link will provide you with more samples and you can discover how to create complex Excel files using the library:
http://www.easyxls.com/manual/index.html

A presentation brochure is available at:
http://www.easyxls.com/docs/EasyXLS_DetailedSpecificationsSheet.pdf

If you are interested and want more details about the library, you can find more information on the following website:
http://www.easyxls.com

(2) Comments    Read More