Export Excel to CSV, XML, HTML, XLSX

IronXL makes it easy to save Excel files in different formats, making it a useful tool for sharing and integrating data. Developers can handle various reporting needs quickly and without hassle. It removes the need for complex conversions with support for multiple formats,. It allows creating well-structured, styled files that work with many applications using minimal code. Exporting to formats like HTML or JSON also simplifies integrating Excel data into web apps and APIs. This streamlines the process, saves time, and boosts productivity for developers.

5 Steps to Save Excel Files in Multiple Formats

  • WorkBook workBook = WorkBook.Create();
  • workBook.CreateWorkSheet("new_sheet")["A1"].Value = "Hello World";
  • workBook.WorkSheets[0]["A1"].Style.BackgroundColor = "#ff6600";
  • workBook.SaveAs("sample.xlsx");
  • workBook.ExportToHtml("sample.html");

The WorkBook.Create method initializes a blank Excel workbook, serving as the foundation for data manipulation. A new worksheet titled "new_sheet" is added, and the value "Hello World" is set in cell A1. This showcases the ability to programmatically populate data into specific cells, which is essential for generating dynamic reports or templates.

Next, the background color of cell A1 is customized using the Style.BackgroundColor property, adding visual emphasis. This step highlights IronXL’s powerful styling capabilities, allowing developers to enhance the readability and presentation of their Excel files.

The SaveAs method is then used to save the workbook in .xlsx format, ensuring compatibility with Excel and other spreadsheet applications. Lastly, the ExportToHtml method converts the workbook into an HTML file, making the data accessible for web-based reports or dashboards. This streamlined process combines flexibility and efficiency, showcasing IronXL's versatility in handling Excel operations.

Click here to view the How-to Guide, including examples, sample code, and files >.