Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Create an Excel file (xls)
Message
De
22/03/2008 12:55:02
 
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Versions des environnements
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows XP
Database:
MS SQL Server
Divers
Thread ID:
01304564
Message ID:
01304580
Vues:
14
>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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform