Convert Spreadsheet File Types
IronXL offers a simple and flexible way for developers to work with Excel files, allowing easy import and export across various formats. It supports file types like XLS
, XLSX
, CSV
, JSON
, XML
, and HTML
, making it ideal for different application needs. Developers can convert Excel data into formats suitable for web integration, APIs, or further data processing with just a few lines of code.
For example, exporting Excel files as HTML or JSON makes it easy to embed data into web applications, while converting them to binary, byte arrays, or streams helps integrate with databases or other systems. Converting Excel content into a DataSet
simplifies connecting to SQL databases or populating UI components like data grids. This reduces manual coding, enhances productivity, and makes IronXL a valuable tool for modern, data-driven applications.
5 Steps to Export Excel Files in Multiple Formats
- WorkBook workBook = WorkBook.Load("Sample.xlsx");
- workBook.SaveAs("exported_file.xlsx");
- workBook.SaveAsJson("exported_file.json");
- DataSet dataSet = workBook.ToDataSet();
- workBook.ExportToHtml("exported_file.html");
This code demonstrates the versatility of IronXL in handling and exporting Excel data across multiple formats. The process begins by loading an existing Excel file, Sample.xlsx
, into a WorkBook
object. This object acts as the central hub for manipulating and exporting data. Using the SaveAs
method, the workbook is saved as an .xlsx
file, ensuring compatibility with modern Excel applications.
Next, the SaveAsJson
method converts the workbook into JSON format, making it suitable for API responses or lightweight data exchanges. The ToDataSet
method enables seamless integration with databases or UI components by converting the workbook into a DataSet
object, which is a .NET-native structure for handling tabular data.
Finally, the ExportToHtml
method generates an HTML file, enabling developers to display the Excel data directly on web pages. These capabilities streamline data processing tasks, making IronXL an exceptional tool for developers working with Excel files.
Click here to view the How-to Guide, including examples, sample code, and files >