你如何使用Excel服务器端? [英] How do you use Excel server-side?

查看:136
本文介绍了你如何使用Excel服务器端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个客户端希望网络使能A S preadsheet计算 - 用户指定的某些单元格的值,然后告诉他们在其他细胞所产生的价值

(他们不想向用户显示一个S preadsheet样的界面,这是不是一个UI的问题。)

他们有一个巨大的小号preadsheet有很多计算过很多很多张。但是,最终,只有两件事情没关系 - (1)你把号码一对夫妇的细胞在一张纸上,和(2)你会得到相应的数字了在另一片一对夫妇的细胞。它的其余部分是一个黑盒子。

我要present的UI给用户输入自己想要的号码,然后我想以编程方式打开Excel文件,设置数字,告诉它重新计算,并读取出结果

这是可能的/可取?是否有商业成分,使这更容易?是他们的陷阱,我不考虑?

(我知道我可以使用办公自动化要做到这一点,但我知道这是不建议做服务器端,因为它试图在用户的上下文中运行,等等。)

编辑:很多人都在说我需要重新在code中的公式。然而,这将是令人吃惊的复合物。这听起来像这可能是一个解决的问题 - 没有人知道某些类型会为我做的一个组成部分?总要有人创造了一些Excel的公式,用于─code发电系统。我会很乐意为它付出。

编辑/解决方案: US preadsheetGear 就是我一直在寻找。在其他方面,它可以让你使用一个XLS作为一个计算器。您可以设置所选单元格的原始值,然后读出计算单元的值。正是我一直在寻找的。

解决方案

您肯定不希望被使用互操作在服务器端,这是够糟糕使用它作为客户端上的一个杂牌组装电脑。

我可以看到两个选项:

图所列的S preadsheet逻辑。这可以通过将业务逻辑的已知量从长远来看有利于你,并在短期内,你可能会发现,居然有在S preadsheet错误(我曾经遇到过用吨的庞然大物US preadsheets的多年,变成有简单的错误在其中 - 每个人都只是假定的答案一定是正确的)

US preadSheetGear.NET 的,它基本上是一个互操作的替代品。做这一切,而不Excel文件(它复制Excel的非视觉逻辑和IO在.NET中的一大块)

A client wants to "Web-enable" a spreadsheet calculation -- the user to specify the values of certain cells, then show them the resulting values in other cells.

(They do NOT want to show the user a "spreadsheet-like" interface. This is not a UI question.)

They have a huge spreadsheet with lots of calculations over many, many sheets. But, in the end, only two things matter -- (1) you put numbers in a couple cells on one sheet, and (2) you get corresponding numbers off a couple cells in another sheet. The rest of it is a black box.

I want to present a UI to the user to enter the numbers they want, then I'd like to programatically open the Excel file, set the numbers, tell it to re-calc, and read the result out.

Is this possible/advisable? Is there a commercial component that makes this easier? Are their pitfalls I'm not considering?

(I know I can use Office Automation to do this, but I know it's not recommended to do that server-side, since it tries to run in the context of a user, etc.)

Edit: A lot of people are saying I need to recreate the formulas in code. However, this would be staggeringly complex. It sounds like this could be a solved problem -- does anyone know of a component of some type that would do it for me? Someone has to have created some "Excel-formula-to-code" generation system. I'd gladly pay for it.

Edit/Solution: SpreadsheetGear is what I was looking for. Among other things, it lets you use an XLS as a calculator. You can set the raw values of selected cells and then read out values of calculated cells. Exactly what I was looking for.

解决方案

You definitely don't want to be using interop on the server side, it's bad enough using it as a kludge on the client side.

I can see two options:

Figure out the spreadsheet logic. This may benefit you in the long term by making the business logic a known quantity, and in the short term you may find that there are actually bugs in the spreadsheet (I have encountered tons of monster spreadsheets used for years that turn out to have simple bugs in them - everyone just assumed the answers must be right)

Evaluate SpreadSheetGear.NET, which is basically a replacement for interop that does it all without Excel (it replicates a huge chunk of Excel's non-visual logic and IO in .NET)

这篇关于你如何使用Excel服务器端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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