Excel 数据访问
我正在尝试设计一个用于访问 Excel 2010(及以前版本)中的数据的解决方案。一些高级要求/约束如下:
- 数据存储在数据库中。
- 用户不应该能够直接连接到数据库。
- 他们可能想要的数据访问类型将被其他应用程序使用。
- 用户希望通过直接导入工作表以及通过 VBA 来处理数据。
据我所知,我想到了以下
- WCF 服务
- 可由其他应用程序使用
- 会引入延迟(如果这是一个问题)
- 如果没有 VBA,无法直接在工作表中使用吗?
- WCF 数据服务
- 可由其他应用程序使用
- 更好的模型可以公开(通过 EF)并使用(RESTful、OData)
- 会引入延迟(如果这是一个问题)
- 可由 PowerPivot 直接使用
- 如果没有 VBA,无法直接在工作表中使用吗?
- 仅兼容 2010,无需 VBA
- Web Query
- 需要更多的精力来构建(需要将 ASP.NET 外观放在数据库前面)
- 无需 VBA 即可直接在工作表中使用
- 与所有必需的 Excel 版本兼容
- 向其他应用程序(非 Excel)公开数据的机制较差 需要更多的努力来构建(
我开始认为不存在一刀切的解决方案,并且必须创建一个用于直接工作表访问的接口和另一个用于其他所有内容的接口,无论是 SOAP 还是 REST 类型的数据服务。
有人有什么建议/经验吗?
谢谢
I am trying to design a solution for accessing data in Excel 2010 (and previous versions). Some high level requirements/constraints are below:
- The data is stored in a database.
- Users should not be able to connect to the database directly.
- The types of data access they are likely to want will be consumed by other applications.
- The users will want to work with the data by directly importing into worksheets and also through VBA.
From my knowledge I thought of the following
- WCF Service
- Can be consumed by other applications
- Will introduce latency (if that is an issue)
- Cannot be consumed directly in worksheet without VBA?
- WCF Data Services
- Can be consumed by other applications
- Nicer model to expose (via EF) and work with (RESTful, OData)
- Will introduce latency (if that is an issue)
- Can be consumed by PowerPivot directly
- Cannot be consumed directly in worksheet without VBA?
- Only compatible with 2010 without VBA
- Web Query
- Requires more effort to build (will need to put together ASP.NET façade in front of database)
- Can be consumed directly in worksheet without VBA
- Compatible with all required versions of Excel
- Poor mechanism for exposing data for other applications (non-Excel)
I am beginning to think there isn't a one size fits all solution does not exist and will have to create an interface for direct worksheet access and another interface for everything else, be it SOAP or REST type data service.
Does anyone have any suggestions/experience?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以摆脱一个接口,只公开两个端点,一个用于 SOAP,一个用于 REST(或者也许您甚至不需要 SOAP 端点?)。对我来说,这似乎是两全其美。听起来它可以满足您的要求(Excel/PowerPivot 可以使用 RESTful 服务),并且可以防止您重复代码。
看一下这个SO问题的示例。
I think you can get away with one interface and just expose two endpoints, one for SOAP and one for REST (or perhaps you don't even need the SOAP endpoint?). That would seem to be the best of both worlds to me. It sounds like it would meet your requirements (Excel/PowerPivot can consume RESTful services), and would prevent you from duplicating code.
Take a look at this SO question for an example.