http://www.pptjcw.com

excel入门教程:Excel服务VI――用Excel Web Services创建应用程

    Excel Services part 6: Building applications with Excel Web Services
    Excel Services(第6部分):用Excel Web Services创建应用程序

    While talking about scenarios for Excel Services, I mentioned “Reusing the logic encapsulated in Excel spreadsheets in custom applications” – which means accessing spreadsheets and their contents server-side via web services in a way that’s scalable and manageable. I would like to elaborate on this topic over a couple of posts. Today, I will introduce “Excel Web Services”; in a follow-up post I will show how to develop a small sample application using said web services.
    在介绍Excel Services 中的方案时,我提到过”在用户自定义程序中重复利用Excel电子表格的逻辑封装”——可升级和管理通过网络服务器访问电子表格和存储信息服务器端。我在上面的一些文章中就这个主题作过详细的介绍。今天,我将介绍“Excel Web Services”,接下来的文章展示如何用网络服务器开发小的应用程序示例。

    In a nutshell…
    概述

    Let’s briefly revisit Excel Services’ architecture. The Excel Calculation Service is the “engine” of Excel Services; it is the component that loads and calculates spreadsheets. In the “interact with the spreadsheet in your browser” scenarios covered in previous posts, Excel Calculation Services loads and calculates a spreadsheet and then hands it off to the Excel Web Access, which is the component that produces the HTML that ends up in your browser. The point of today’s post (and the post that will follow) is that developers can also use Excel Calculation Services without needing to interact with the Excel Web Access. Specifically, we have built a web service API directly on top of the Excel Calculation Services so that developers can call server-side spreadsheets directly from their own applications. For example, developers could write code that opens a spreadsheet on a server, sets cells and ranges to specific values, controls external data refresh and workbook calculation, and finally retrieves values from the calculated workbook (or retrieves the workbook in its entirety). Let’s look at some more specific examples.
    先简单地回顾一下Excel Services架构 。Excel Calculation Service是Excel Services的”引擎”,是装载和计算电子表格的组件。在上篇文章中介绍了”在浏览器中与电子表格相交互”, Excel Calculation Service装载和计算电子表格,并且不需要Excel Web Access(配置在浏览器中生成HTML的组件)。这篇文章接下来介绍开发者不需要Excel Web Access的配合也能运用Excel Calculation Service。具体地讲,我们在Excel Calculation Service中已经直接创建了一个网络服务器API,以便于开发者能在他们自己的应用程序中直接调用网络服务器端的电子表格。例如,开发者能够写用来打开服务器上的电子表格的代码,设置单元格和区域为指定值,控制外部数据更新和工作薄计算,并且最后从已经过计算的工作簿中取回数值(或取回整个工作薄)。下面列举了一些更详细的例子。

    What sorts of things are these web services good for?
    这些网络服务有哪些功能?

    • Excel Web Services enables many interesting scenarios. Here are two examples that we have heard repeatedly from our customers.
    Using the logic in Excel spreadsheets in a server application – without the “traditional” need to recode this logic in a programming language. In this scenario, the business expert who authored the spreadsheet can keep maintaining the model in Excel; the administrator can protect that model on the server using the appropriate set of users, roles, permissions, and a firewall; and the developer can call Excel Web Services to incorporate the logic in the spreadsheet into the rest of a custom solution. Another variation on this would be providing custom UI to Excel-based server applications which use Excel Web Services to interact with a server-side calculation session.

    Excel Web Service能处理一些有趣的情况。下面有两个经常从我们的客户那里听到的例子。
    在服务器应用程序中的电子表格上运用逻辑——不需要使用”传统的”方法,即用编程语言重新编
    写这些逻辑代码。在这种情况下,创建电子表格的商务专家能在Excel中维护这个模型;管理员
    能在服务器上使用合适的用户权限设置来保护模型;开发者能调用Excel Web Services在用户
    解决方案部分加入电子表格逻辑。在这方面的另一个变化是为基于Excel服务器应用程序提供了
    自定义用户界面,该服务器应用程序使用Excel Web Services与服务器端计算进程进行交互。

    • Automating spreadsheet updates on servers. This works especially well in combination with the new Open XML file format, which greatly simplifies the task of programmatically creating an Excel file from scratch or using a template. Once the new file has been created, it often needs to be calculated – for example, if there are external data feeds that need to be updated. It is straightforward for developers to write code to use Excel Web Services to do all of this, then retrieve an up-to-date copy of the calculated file and save it back to the server, or deliver it to any other destination.
    在服务器中自动更新电子表格。这项功能相当好地组合在全新Open XML文件格式中,可非常简单地自动编程完成从稿纸或模板创建一个Excel文件的任务。一旦创建了这个新文件,就经常需要计算它——例如,如果有需要更新的外部数据,开发者可以直接写代码去指令Excel Web Services完成所有这些工作,然后取回这个已经过计算的文件副本并存储在服务器上,或者将它传送到另一个目标上。

    What specifically can the web service do?
    网络服务器具体处理什么工作?

    提示:如果您觉得本文不错,请点击分享给您的好友!谢谢

    上一篇:excel宏教程:Excel Services代码示例 下一篇:excel表格教程:Excel图片自动更新

    郑重声明:本文版权归原作者所有,转载文章仅为传播更多信息之目的,如作者信息标记有误,请第一时间联系我们修改或删除,多谢。