所以我真的不能使用Excel对象模型在服务器端使用吗? [英] So I really can't use Excel Object Model to be used server-side?

查看:68
本文介绍了所以我真的不能使用Excel对象模型在服务器端使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试开发一个c#/asp.net应用程序,以从SQL Server中提取数据并将其格式化为excel电子表格.我一直在使用excel对象模型进行练习,最近偶然发现: http://support.microsoft.com/kb /257757 Office的服务器端自动化的注意事项

I'm trying to develop a c#/asp.net application to extract data from a SQL server and have it formatted in an excel spreadsheet. I have been practicing with excel object model and recently stumbled upon this: http://support.microsoft.com/kb/257757 Considerations for server-side Automation of Office

据我了解,我真的不能使用Excel对象模型?如果不是,除了本文和我可以使用的第三方应用程序中所建议的内容以外,还有什么其他解决方案/建议?

From what I understand I really can't use Excel Object models? And if not what are other solutions/advice besides whats suggested in this article and 3rd party apps I can use?

推荐答案

从该文章开始:

Microsoft当前不建议,并且不支持, 从任何无人值守的Microsoft Office应用程序自动化, 非交互式客户端应用程序或组件(包括ASP, ASP.NET,DCOM和NT服务),因为Office可能表现出不稳定 在这种环境中运行Office时的行为和/或死锁.

Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

这意味着Microsoft不会明确阻止您尝试(许可允许您尝试.)但是,如果有问题,则由您自己决定如何解决.

What this means is that Microsoft won't explicitly prevent you from trying (the licensing allows you to try.) However, if there is a problem, it's up to you to figure out how to fix it.

还有一个更好的选择:

从C#创建Excel(.XLS和.XLSX)文件

这将使您无需在服务器端使用Excel自动化即可创建要下载的文件.

This will allow you to create the file for download without having to use Excel automation on the server side.

这篇关于所以我真的不能使用Excel对象模型在服务器端使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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