Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Create an Excel file (xls)
Message
From
22/03/2008 12:55:02
 
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01304564
Message ID:
01304580
Views:
13
>Can someone tell me how I can create an Excel formatted file in C#. Right now, I am using the Streamwriter class to write out a comma delimited file one column at a time. But I would like to also have the option to write out to Excel format.

The goal is to change your dataset into xml. Then, create a generic xsl file that is capable of creating a workbook, a worksheet and have the code to handle each row based on the field type such as string, datetime, integer and boolean so you can apply some business logic in there. Then, you can do a XslCompiledTransform.Transform() to obtain your Excel xml file.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Reply
Map
View

Click here to load this message in the networking platform