简体   繁体   English

导出XML-> Excel

[英]export XML -> Excel

I'm already generating an excel XML file (.xml) containing 2 worksheets. 我已经在生成一个包含2个工作表的Excel XML文件(.xml)。

issue #1: 问题1:

the people downloading the XML file wouldn't know to open the file in Excel. 下载XML文件的人不知道在Excel中打开文件。 (they'd complain.) (他们会抱怨)。

solution #1: 解决方案1:

I rename the file to .XLS instead of .XML. 我将文件重命名为.XLS而不是.XML。

issue #2: 问题2:

when opening the file in Excel i get the this error: 在Excel中打开文件时,出现以下错误:

The file you are trying to open, ‘XXX.xls’ is in a different format than specified   by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file.

Solution #2: 解决方案2:

Convert the XML file to XLS file somehow. 以某种方式将XML文件转换为XLS文件。

so here's where i turn to you... 所以这是我转向你的地方

Goal: 目标:

they need to be able to open the file by double-clicking it. 他们需要能够通过双击打开文件。 i don't want to have to rebuild the excel file using some 3rd party library. 我不想使用某些第三方库来重建excel文件。

Ideas: 想法:

perhaps convert XML to xls using tools like the following: 也许可以使用以下工具将XML转换为xls:

http://npoi.codeplex.com/
http://excelpackage.codeplex.com/

I'd need some sample code of the simplest and LITEst way of achieving this. 我需要一些实现此目的的最简单和最简单方法的示例代码。

any other ideas? 还有其他想法吗?

只是一个随机的想法:如果要生成供人们使用Excel打开的XML,为什么不首先生成XSL(或maby XSLX)呢?

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

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