How can I Create an Excel Sheet with Microsoft.Office.Interop.Excel.dll?
How can I create an Excel sheet with Microsoft.Office.Inte开发者_JAVA百科rop.Excel.dll in ASP.NET?
Have you considered a 3rd party library e.g. SpreadsheetGear (http://www.spreadsheetgear.com/) or OfficeWriter (http://officewriter.softartisans.com/)? I have used both of these sucessfully on separate projects to export data into complex spreadsheets.
So long as your happy to create .XLSX (xml based spreasheets) you can do this in ASP.NET using the new packaging namespaces that come with .NET, no need to invest in 3rd party vendor solutions...
How to create a spreadsheet document without excel.interop
write and read values into/from cells.
Code snippets for working with open xml office files
Good general coverage of how to manipulate specific files/parts of a open xml file
I should add that in answer to your question using the Microsoft.Office.Interop.Excel namespace is an unsupported and is not recommended for use with server side unattended scenarios such as running in a asp.net worker process. There is numerous coverage of this in ms kb articles. use the above or invest in a 3rd party vendor solution that leverages .net.
精彩评论