DataTable is a memory representation of database with collection of rows and columns. Data in an existing worksheet can also be exported to data tables and CLR objects.
Essential XlsIO supports exporting DataTable to Excel worksheet using ImportDataTable. To achieve this, first you need to load data into DataTable instance and the loaded table can be exported to Excel worksheet.
ImportDataTable feature exports the datatable to Excel including the formatting. For example, if the string type contains ‘%’,’$’,’Date’, etc., gets exported with respective formatting applied on the cell.
Steps to export DataTable to Excel programmatically:
A complete working sample can be downloaded from Export-DataTable-to-Excel-with-Formatting.zip.
By executing the program, you will get the DataTable as follows.
Know more about Essential XlsIO through the , where you can find supported features like and in DataTable, appending multiple records to worksheet using , exporting worksheet into etc., with respective code examples.
Starting with v16.2.0.x, if you reference Syncfusion assemblies from trial setup or from the NuGet feed, include a license key in your projects. Refer to to learn about generating and registering Syncfusion license key in your application to use the components without trail message.
|Article ID:||Published Date:||Last Revised Date:||Platform:||Control:|