I often see how to handle the Excel file, here is tap, welcome to supplement.
▲ 1. Operation via Excel ★ Limit: You need to install Excel ▲ 1.1, using the Interop method. Reference: "Creating An Excel Spreadsheet and Add Data To It Programmatical" http://www.csharphelp.com/archives/archive241.html ▲1.2, using reflection technology. Reference: "Calling a COM Component from C # (Late Binding" http://www.c-sharpcorner.com/1/call_com.asp
▲ 2, output the Excel program that can be compatible with the file (Note 1) as an Excel file. ★ Limit: a, can only be used for output, B, CSV only supports single page (Worksheet), that is, only single-page Excel files. (Note 2) C, can't control format, can't do it like Cell.
▲ 3, use the XML import function supported by Office 2003 to generate Excel to import XML files. ★ Limit: a, can only be used to output, B, and low versions are not supported.
▲ 4, according to the Excel file format (Note 3), the method of writing binary files is generated. ▲ 4.1, use third-party controls, such as aspose, website http://www.aspose.com. ★ Restriction: to spend money. ▲ 4.2, write it yourself, refer to http://www.cnblogs.com/unruleDboy/archive/2004/07/07/22093.html, good Chinese introduction, only did not introduce his source of information, and A single sheet mode is implemented. Try to go this way to http://www.sourceforge.net Search OpenSource About Microsoft Office's File Format. In fact, the 4.1 mentioned ASPOSE is used, but it is only packaged with an aliasing, and it began to sell money. ★ Restriction: The workload is large.
Mencius reminded, add one
▲ 5, use the ActiveX control so that the user remotely operates the Excel file. Reference: "How to open directly, edit, create a Office document on the web page" http://blog.joycode.com/kaneboy/archive/2004/11/37889.aspx limit: a, the client directly on Browser Operation of files on Server, the Server side needs to configure the appropriate permissions B, the client needs to install Office XP SP3 or you register your Office's ActiveX control "OWSSUPP.DLL" C, the client operates directly on the server on the Browser, Server The content and change of the document cannot be controlled.