Is there a way to create Excel files in C# using a template without using the interop [closed]
开发者_JS百科
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 8 years ago.
Improve this questionI am updating an internal application that creates excel files based on a template, and I would like to recreate that functionality without having to use the excel interop. Does anyone know of any open source projects that can do this? I was using ExcelLibrary, but it does not work with the template.
Thanks!
EDIT: I am only interested in solutions that are known to work with existing *.xlt or *.xltx templates. Solutions where this is unknown are not helpful. Those can be found all over the web.
See OpenXML 2.0 from MS...
It is a free library that does NOT require office to be installed... you can read + write Office files including Excel and Word (Version 2007 and up...).
IF you need more features (like rendering to PDF etc.) and/or support for pre-2007 formats (like XLT) then you would need some 3rd-party library... not opensource... but take a look at Aspose.Cells - it handles XLT, XLTX, XLTM etc. too - for example regarding support for XLTX + XLTM see http://www.aspose.com/documentation/.net-components/aspose.cells-for-.net/feature-overview.html
Have a look at the following link, This library allows you to generate Excel Workbooks using XML, hope this help.
CarlosAg Excel Xml Writer Library
Can you try these libraries depending on whether you want to work with Excel 2003/2007 or 2010.
NPOI
koogra
Check out the Open XML SDK 2.0 from Microsoft. Then you can use the Simple OOXML project to get you started. Does not work for legacy office documents (i.e. doc/xls) only the new ones like docx and xslx.
hint: a docx/xslx is really a zip file full of xml documents. just change the extension to zip.
We've used OpenXml to generate Word documents. I'm sure you can generate Excel files as well.
精彩评论