将dataobject导出到格式化的Excel文件 [英] Export dataobject to formatted excel file

查看:127
本文介绍了将dataobject导出到格式化的Excel文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嘿,我一直在尝试将数据对象导出到格式良好的excel spreedsheet中,但还​​没有弄清楚该怎么做.

我尝试过的事情
-我可以创建一个.csv文件,但不能使用.csv格式.
-此外,出于安全原因,不允许使用Interlop库.

您可能还知道其他方法吗?

我当时在想Jet或Ace.或作为具有XSL样式的XML文件.我研究了完成此任务的不同方法,但是我没有找到指南来告诉我完成该任务需要做什么.

Hey, I have been trying to export a dataobject to a nicely formatted excel spreedsheet and have not figured out how.

Things I''ve tried
-I can create a .csv file but you can not format in .csv.
-Also the Interlop library is not allowed due to security reasons.

Are there any other ways that you might know of to do it?

I was thinking Jet or Ace. Or maybe as an XML file with XSL styling. I''ve looked at different ways to do it but I haven''t found a guide that tells me what I have to do to accomplish such a task. Any help would be greatly appreciated!

推荐答案

如果您的目标是Excel 2003及更高版本,那么可以使用XML.

以下是有关如何执行此操作的链接:
在C#中生成Excel(XML电子表格) [
If you are targetting Excel 2003 and higher then yes XML can be an answer.

below is the link talks about how to do this:
Generating Excel (XML Spreadsheet) in C#[^]

Thanks,
Hemant


这篇关于将dataobject导出到格式化的Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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