SSRS 中运行时的动态图表
我需要在 SQL reporting services 2008 中创建一个报告(rdl)。我需要在运行时创建。 报告有图表。 我将在运行时指定图表的类型、字体、对齐方式以及所有这些内容。
是否有任何选项可以在 SSRS 2008 中使用它?
I need to create a report(rdl) in SQL reporting services 2008. In that I need to create in runtime. The report has chart. I will specify the type of chart, font, alignment and all those stuff in runtime.
Is there any option for using this in SSRS 2008.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
rdlc 只是一个 xml 文件,因此您可以在运行时操作它,但这并不是一项简单的任务。 您可以在 http://download.microsoft.com/download/6/5/7/6575f1c8-4607-48d2-941d-c69622e11c32/RDL_spec_08.pdf。
有一个为表和矩阵动态创建 rdlc 的可下载示例,以及许多其他有用的报告查看器信息,位于 http://www.gotreportviewer.com/。
An rdlc is just an xml file so you can manipulate it at runtime, it's not a trivial undertaking though. You can find the rdl spec at http://download.microsoft.com/download/6/5/7/6575f1c8-4607-48d2-941d-c69622e11c32/RDL_spec_08.pdf.
There's a downloadable example of creating an rdlc for a table and a matrix dynamically, as well as lots of other useful report viewer info at http://www.gotreportviewer.com/.
您可以根据需要生成 RDL,它只是一个 XML 文件。 但您只能在本地运行该报告。 要在服务器上运行,您需要首先部署报告,因为服务器不直接运行 RDL 文件。
我想这仍然是可能的,但是会非常慢,并且报告不会出现在报告管理器或任何事先的内容中。
但是,您可能使这个问题变得比实际需要的更加复杂。 我参与过一些项目,其中我们生成 RDL 并每天使用自定义应用程序进行部署,但这几乎总是不值得。 通常有更好的方法。
您可以使用表达式设置图表的几乎所有参数。 唯一无法设置的是图表类型,但也有一些方法可以解决这个问题。 就像在页面上创建您需要的所有图表类型一样,但使除您想要的图表类型之外的所有图表类型都可见。
You can generate the RDL however you want, it is just an XML file. But you will only be able to run the report locally. To run on the server you would need to deploy the report first, as the server does not run the RDL files directly.
I suppose this is still possible, but it would be pretty slow, and the report would not appear in the report manager or anything before hand.
However, your probably making this problem more complicated than it needs to be. I have work on projects where we generated the RDL and deployed daily with a custom application, and it is almost always not worth it. There is usually a better way.
You can set almost all the parameters of the chart using expressions. The only thing that can't be set is the chart type, but there are ways to get around that as well. Like having all the chart types you need created on the page, but making all except the one you want visible.
是的...
为此,您需要修改现有的 rdl 文件,或者需要完全从代码生成它。
所有 SSRS xml 都存储在数据库中名为目录的表中。 您必须使用该报告的 GUID 来访问它,或者插入新行来创建新报告。
完成交换报表服务器 xml 后,报表服务器将有一个“新”报表,您可以通过网页或 SSRS url 参数调用该报表。
如果您认为有必要,请过去清理目录表。
不过,老实说,这与最佳实践相去甚远,据我所知,最佳实践是以小部件的形式嵌入您需要在网页中显示的数据。
Yes...
to do so, you will need to either have an existing rdl file to modify, or you need to completely generate it from code.
All the SSRS xml is stored in the database in a table called catalog. You'll have to use the GUID of that report to access it, or insert a new row creating a new report.
once you're done swapping out your report server xml, the report server will have a "new" report that you can then call via your web page, or via SSRS url parameters.
past that clean up the catalog table if you see the need to.
I'll be honest with you though, this is very far from best practice, best practice that I'm aware of would be to embed the data you need to display in your web page in the form of a widget.