彩票走势图

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

原创|其它|编辑:郝浩|2012-10-08 14:42:59.000|阅读 932 次

概述:Microsoft Excel 2002提供了一种新特性来实时查看和更新数据代替原有的动态数据交换Dynamic Data Exchange(DDE),这一新途径一直沿用到后来的Excel 2003、2007、2010和2013版本。这个特性的强大之处是处理不断变化的数据比如股票报价、汇率、库存水平、报价、天气预报、体育成绩等等。Add-in Express支持RTD技术,并提供与COM插件和Smart Tags智能标记相同的RAD的方式。对于Excel GUI的高级定制,Add-in Express还提供了一些高级任务窗格Advanced Task Panes并支持EExcel Automation以及XLL外接程序用于开发自定义用户定义函数(UDF)。

# 慧都年终大促·界面/图表报表/文档/IDE等千款热门软控件火热促销中 >>

Microsoft Excel 2002提供了一种新特性来实时查看和更新数据代替原有的动态数据交换Dynamic Data Exchange(DDE),这一新途径一直沿用到后来的Excel 2003、2007、2010和2013版本。这个特性的强大之处是处理不断变化的数据比如股票报价、汇率、库存水平、报价、天气预报、体育成绩等等。Add-in Express支持RTD技术,并提供与COM插件和Smart Tags智能标记相同的RAD的方式。对于Excel GUI的高级定制,Add-in Express还提供了一些高级任务窗格Advanced Task Panes并支持EExcel Automation以及XLL外接程序用于开发自定义用户定义函数(UDF)。下面是这一特性的具体介绍:

1. Create a new Excel RTD Server project

To create a new real-time data server project with Add-in Express, close all opened solutions, choose File | New | Project, select the "Other Projects | Extensibility Projects" item, click the Add-in Express RTD Server icon, and click the OK button.

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

This will start the wizard that asks you to select a programming language, either C# or VB.NET, and then generates the project.

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

2. RTD Server module

The project contains an RTD Server module, which is the core part of every Excel RTD Server developed with Add-in Express. The file name for the module is RTDServerModule.vb or RTDServerModule.cs for VB.NET and C# projects respectively. You place RTD Server Topic components onto the module's designer in order to create the information interface of your RTD Server. To add topics to your real-time date server, the module provides a special command available either in the Properties window or in the context menu of the module's designer. Also, you handle RTD Server properties and events in the module.

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

Refresh interval for the RTD server

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

Allows specifying if the RTD server should be registered for all users on the PC

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

When Excel initializes and closes the RTD server

3. Excel RTD Server topics

An RTD Server topic component allows you to specify a part of the information flow provided by the Excel real-time data server. You identify the topic using its properties and handle its RefreshData event.

Private Function TopicLastPrice_RefreshData(sender As System.Object) As System.Object _

Handles TopicLastPrice.RefreshData

 

Dim actualTopic As AddinExpress.RTD.ADXRTDTopic = _

CType(sender, AddinExpress.RTD.ADXRTDTopic)

Dim symbol As String = actualTopic.String02

Try

If IsValidSymbol(symbol) Then

Return GetLastPrice(symbol)

Else

Return "Unknown symbol"

End If

Catch ex As Exception

Return "error"

End Try

End Function

Private Function TopicLastPrice_RefreshData(sender As System.Object) As System.Object _

Handles TopicLastPrice.RefreshData

 

Dim actualTopic As AddinExpress.RTD.ADXRTDTopic = _

CType(sender, AddinExpress.RTD.ADXRTDTopic)

Dim symbol As String = actualTopic.String02

Try

If IsValidSymbol(symbol) Then

Return GetLastPrice(symbol)

Else

Return "Unknown symbol"

End If

Catch ex As Exception

Return "error"

End Try

End Function

 

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

String01, String02, ... String28 - these properties allow uniquely identify the topic

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

The default value for the topic

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

When the rtd topic is connected and disconnected

微软Office部署工具Add-in Express .Net如何创建Excel RTD服务器

When the topic is required to refresh its value

4. Deploying the real-time data server

You deploy and update your Excel RTD server in a variety of ways described in the Developer Tutorial: Step 7. Deploying the RTD server. Your real-time data server can be per-user or per-machine, i.e. for all users on the PC.

You may also be interested in:

  • A series of articles by an independent software vendor who shared his experience of developing a real-life RTD server using Add-in Express: .
  • How to create an integrated Excel extension: .

标签:

本站文章除注明转载外,均为本站原创或翻译。欢迎任何形式的转载,但请务必注明出处、不得修改原文相关链接,如果存在内容上的异议请邮件反馈至chenjj@pclwef.cn

文章转载自:慧都控件网

为你推荐

  • 推荐视频
  • 推荐活动
  • 推荐产品
  • 推荐文章
  • 慧都慧问
扫码咨询


添加微信 立即咨询

电话咨询

客服热线
023-68661681

TOP