Test in production without watermarks.
Works wherever you need it to.
Get 30 days of fully functional product.
Have it up and running in minutes.
Full access to our support engineering team during your product trial
In this tutorial, we delve into Excel manipulation using IronXL in C#. The session begins with setting up a C# project in Visual Studio and integrating IronXL via the NuGet package manager. By importing IronXL, users can leverage its capabilities to load Excel files and restructure data intelligently. The tutorial highlights the simplicity of exporting Excel files into multiple formats, including XLS, TSV, CSV, JSON, XML, and HTML, using the SaveAs
method. Specialized methods ensure clean conversion for CSV, JSON, and XML formats, while HTML transformation enhances data presentation. By running the program, users witness IronXL's prowess in crafting and transforming Excel files into various formats. The tutorial underscores the endless possibilities for creating reports, sharing data, and making presentations. It also mentions IronXL's compatibility with interop and additional transformation features. Viewers are encouraged to explore further through the provided link for more data type conversions and to try a trial subscription of IronXL. As always, feedback through likes and subscriptions is welcomed for more insightful tutorials.
// Include the IronXL library
using IronXL;
class Program
{
static void Main()
{
// Load the Excel file
WorkBook workbook = WorkBook.Load("Sample.xlsx");
// Access the first worksheet in the workbook
WorkSheet sheet = workbook.WorkSheets.First();
// Display some cell values (example)
Console.WriteLine("Value in Cell A1: " + sheet["A1"].StringValue);
Console.WriteLine("Value in Cell B1: " + sheet["B1"].StringValue);
// Export the file into a different format
workbook.SaveAs("SampleOutput.csv", "CSV");
// Possible additional exports
workbook.SaveAs("SampleOutput.json", "JSON");
workbook.SaveAs("SampleOutput.xml", "XML");
// Inform user that the process is complete
Console.WriteLine("Excel file has been exported to other formats.");
}
}
// Include the IronXL library
using IronXL;
class Program
{
static void Main()
{
// Load the Excel file
WorkBook workbook = WorkBook.Load("Sample.xlsx");
// Access the first worksheet in the workbook
WorkSheet sheet = workbook.WorkSheets.First();
// Display some cell values (example)
Console.WriteLine("Value in Cell A1: " + sheet["A1"].StringValue);
Console.WriteLine("Value in Cell B1: " + sheet["B1"].StringValue);
// Export the file into a different format
workbook.SaveAs("SampleOutput.csv", "CSV");
// Possible additional exports
workbook.SaveAs("SampleOutput.json", "JSON");
workbook.SaveAs("SampleOutput.xml", "XML");
// Inform user that the process is complete
Console.WriteLine("Excel file has been exported to other formats.");
}
}
Further Reading: How to Convert Spreadsheet File Types