简体   繁体   English

从 XML 生成 Excel 文档

[英]Generating Excel Documents from XML

In my build automation, I have a NAnt task that uses C# Linq2XML and an Office Interop library to generate an Excel (.xls ) document based on an input XML file.在我的构建自动化中,我有一个 NAnt 任务,它使用 C# Linq2XML 和 Office 互操作库根据输入 Z3501BB093D363810B671059B9CFED3 文件生成 Excel (.xls) 文档。 We also have a similar process that uses a xslt to generate an HTML page.我们还有一个类似的过程,它使用 xslt 生成 HTML 页面。

I can't help think I'm reinventing the wheel.我忍不住想我在重新发明轮子。 Can anyone suggest a program/library that basically acts like a transformation engine?任何人都可以建议一个基本上像转换引擎一样的程序/库吗?

Does it have to be XLS?它必须是XLS吗? or can it be XLSX?还是可以是 XLSX? Because XLSX is just zipped XML.因为 XLSX 只是压缩 XML。 Unzip it and see the directory structure of xml files.解压后查看xml文件的目录结构。 You can create one by writing XML files and zipping them.您可以通过编写 XML 文件并压缩它们来创建一个。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM