服务器如何远程访问另一台计算机上安装的办公室? [英] How can a server get remote access to office installed on the other machine?

查看:77
本文介绍了服务器如何远程访问另一台计算机上安装的办公室?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好。

接下来的任务是:服务器通过使用Microsoft.Office.Excel.Interop库和来自数据库的brut数据创建漂亮的图表(条形图,条形图,线条) Microsoft Office对象库14中的COM对象。但是在服务器计算机上安装Office是有限制的。



有一个想法是在远程计算机上安装Office ,而不是在服务器上,并从服务器访问它。

如何实现? (通过什么和如何)。任何想法?

提前感谢您,非常感谢任何帮助!

Hello to everybody.
The task is next: the server creates nice charts (bars, pies, lines) from brut data from Database by using Microsoft.Office.Excel.Interop library and by the COM objects in Microsoft Office Object library 14. But there is a restriction to install Office on the server machine.

There is an idea to have Office installed on a remote machine, not on the server, and to access it from the server.
How can it be implemented? (via what and how).Any ideas?
Thank you in advance, any help is highly appreciated!

推荐答案



Microsoft目前不推荐也不支持Microsoft Office应用程序自动化从任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务),因为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.



如果在服务器上安装Office,您将很难使其工作。如果你让它工作,你必须做好准备,它可以在没有任何警告的情况下随时再次停止工作。



虽然可能能够使用类似远程处理 [ ^ ]或 WCF [ ^ ]要在另一台计算机上驱动Office,您仍然需要在该计算机上进行非交互式处理以自动化Office应用程序。



你最好不要看一个根本不需要Office的图书馆。例如, EPPlus [ ^ ]可以生成Excel工作簿,包括图表。或者,如果您只是想要图表,例如 Chartist [ ^ ]或图表.js [ ^ ]可以解决问题。


If you install Office on the server, you'll struggle to make it work. If you do get it to work, you'll have to be prepared for the fact that it could stop working again at any time without warning.

Whilst you might be able to use something like Remoting[^] or WCF[^] to drive Office on a different computer, you'd still need a non-interactive process on that computer to automate the Office application.

You'd be better off looking at a library which doesn't require Office at all. For example, EPPlus[^] can generate Excel workbooks, including charts. Or, if you just want charts, something like Chartist[^] or Chart.js[^] would do the trick.


现在如何访问? Excel dll是否作为参考添加?



我想你可以使用Reflection来通过网络共享加载dll,但我相信你会违反微软的许可协议,如果你这样做的话。最好获得许可并正确合法地执行。
How is it accessed now? Was the Excel dll added as a reference?

I suppose you might be able to use Reflection to the load the dll over a network share but I believe you will be violating Microsoft's license agreement if you do it that way. Best to get a license and do it correctly and legally.


如果要创建Excel文件:



使用Open XML SDK或任何第三方产品。 Office互操作不适用于服务器。它是缓慢且单用户的。



Office互操作旨在由桌面应用程序在本地使用,以自动执行该计算机上的某些任务。



使用Open XML SDK,您可以生成包含图表的Excel文件。





如果你想创建图表图像:



使用任何第三方图表库。



如果你想在网页上与用户互动,那么使用基于jQuery的图表。



有很多选择。有些免费。一些商业广告。对于大多数软件包,你可以通过一些方法获得非常好的图表,使其比其他图表更容易。
If you want to create Excel files:

Uses Open XML SDK or any third party product. Office interop is not designed to be used on server. It is slow and single-user.

Office interop is intended to be used locally by desktop application to automate some task on that computer.

With Open XML SDK, you can generate Excel files containing charts.


If you want to create chart images:

Use any third-party chart Library.

If you want to interact with the user on a web page, then use a chart based on jQuery.

There are a lot of options. Some free. Some commercials. With most package, you can get quite nice charts by some make it easier than others.


这篇关于服务器如何远程访问另一台计算机上安装的办公室?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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