从C#到Excel 03/07获取数据 [英] Getting data from C# to Excel 03/07

查看:123
本文介绍了从C#到Excel 03/07获取数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我拥有使用C#应用程序处理的具有大量实时数据的文件。处理数据后,它将使用特定模板在Excel中显示。



今天使用Interop解决了这个问题。我必须说我不完全排除整个Interop的情况。我必须在每个终端用户终端上手动安装Interop功能?如何处理2003/2007版本的组合?

解决方案

如果您知道Excel文档的结构(并假设您不要和Excel文档中的复杂宏/函数/ etc),您可以使用Excel XML格式生成XML。 我不是指OpenXML,我指的是在2007年之前Excel使用的XML格式。



我涵盖了如何做在这里: http:// www.aaron-powell.com//blog/september-2008/linq-to-xml-to-excel.aspx



Interop的问题是它不是真正设计用于硬核文档生成。如果您尝试执行大量文档处理,您可以执行锁定


I have files with tons of real time data that I process with an C# application. After processing the data it is presented in Excel using a specific template.

This is solved using Interop today. I must say I don't completely gasp the whole Interop situation. Do I have to manually install the Interop functionality on each end user terminal somehow? How does it handle the mix of 2003/2007 versions?

解决方案

If you know the structure of your Excel document (and presuming you don't want and kind of complex macros/ functions/ etc within the Excel document) you can generate XML using the Excel XML format. I'm not referring to OpenXML, I'm referring to the XML format used by Excel prior to 2007.

I cover how to do it here: http://www.aaron-powell.com//blog/september-2008/linq-to-xml-to-excel.aspx

The problem with Interop is that it isn't really designed to hard core document generation. If you try and do a lot of document processing you can run into locks

这篇关于从C#到Excel 03/07获取数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆