Microsoft.Reporting.* 与 XML/XSLT [英] Microsoft.Reporting.* vs XML/XSLT

查看:37
本文介绍了Microsoft.Reporting.* 与 XML/XSLT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想为 .NET 应用程序添加报告功能.我的数据源只是应用程序的数据模型,即一堆可能从任何东西(不一定从数据库)生成或加载的对象.

I would like to add reporting capabilities to a .NET application. My data source is just the data model of the application, i.e. a bunch of objects that may have been generated or loaded from anything (not necessarily from a database).

最初的计划是从这些对象生成报告数据 XML 文件,然后使用 XSLT 将其转换为 XHTML 报告文件.然后可以使用浏览器控件在应用程序中显示该报告.

The initial plan was to generate a report data XML file from these objects, and then use XSLT to transform this into an XHTML report file. The report can then be shown in the application with a browser control.

但是,我注意到存在 Microsoft.Reporting.* 命名空间,并且根据我的尝试,其中的类和控件似乎也可以处理我的报告.改用它是个好主意吗?与 XML/XSLT 方法相比,它会节省工作吗?我可能会遇到 Microsoft Reporting 框架的哪些限制(如果有)?

However, I've noticed that there exist Microsoft.Reporting.* namespaces and from what I've tried, it seems that the classes and controls in there can also take care of my reporting. Would it be a good idea to use this instead? Will it save work compared to the XML/XSLT approach? What limitations (if any) of the Microsoft Reporting framework am I likely to run into?

推荐答案

需要考虑的几件事.

1) Reporting Services 是 Sql Server 的一部分,所以如果你走那条路,你可能会遇到额外的许可证问题.

1) Reporting Services are part of Sql Server, so you may have an extra license issue if you go that route.

2) Reporting Services 可以提供网页,或者在 WinForms 中使用完整的分页、排序、子报告、总计等 - 这在 XSL 中真的很难.它还可以很好地与打印机配合使用.

2) Reporting Services can serve up web pages, or be used in WinForms with full paging, sorting, sub reports, totals etc etc - that's really hard in XSL. It will also play nicely with printers.

3) 报告服务带有一个 WYSIWYG 编辑器来构建报告.它无论如何都不完美,但比手工制作要容易得多.

3) Reporting services comes with a WYSIWYG editor to build reports. It's not perfect by any means, but a lot easier than hand crafting.

4) 使用 XSL 创建 XHTML 可能会真正影响性能.XSL 适用于整个 XML Dom,如果您正在处理多页报告,它可能是一个大文档.我希望 Reporting Services 的工作速度更快.

4) Using XSL to create XHTML can be real performance hit. XSL works on an entire XML Dom, and that maybe a big document if you're dealing with a multipage report. I'd expect Reporting Services to work a lot faster.

5) Reporting Services 可以利用整个 .Net,因此您可以免费获得许多其他功能.

5) Reporting Services can leverage the whole of .Net, so you can get a lot of other functionality for free.

考虑到所有这些,使用 Reporting Services 将节省您的时间,除非您的报告要求非常简单.不过没那么好玩.

Taking all that on board, using Reporting Services will save you time, unless your reporting requirements are very simple. It is less fun though.

这篇关于Microsoft.Reporting.* 与 XML/XSLT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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