简体   繁体   English

更改服务器执行的SSRS报告上的数据集

[英]Changing the dataset on a server executed SSRS Report

I'm trying to narrow down the results returned from a server generated SSRS report, but the customer is requesting too many fields to do be able to do it easily with parameters into a predefined SQL statement. 我试图缩小从服务器生成的SSRS报告中返回的结果,但是客户要求的字段太多,以致于无法使用预定义的SQL语句中的参数轻松地做到这一点。

Is it possible to pass a statement into the reporting server from .NET that the server will execute as its datasource, instead of the preconfigured one? 是否可以从.NET向报表服务器传递一条语句,该语句将服务器作为其数据源而不是预先配置的数据源执行? Either the complete statement or the WHERE clause would be fine. 完整的语句或WHERE子句都可以。

If not, is it possible to eval a parameter sent into a stored procedure? 如果不是,是否可以评估发送到存储过程中的参数? I'm aware of the security implications. 我知道安全隐患。

Architecturally speaking, if the customer is requesting reports with infeasible amounts of parameters they might want to consider creating an Analysis Services model instead and using Excel or another tool to slice and dice the data to their hearts content. 从体系结构上讲,如果客户请求的参数数量不可行,他们可能希望考虑创建Analysis Services模型,并使用Excel或其他工具将数据切成薄片并将其切成小块。

I can't speak to the .NET option, but you can definitely use a stored procedure in a report data set, but I'm not sure how that would help you as it would still require parameters to be passed to it. 我无法说说.NET选项,但是您绝对可以在报表数据集中使用存储过程,但是由于仍需要将参数传递给它,因此我不确定这将对您有什么帮助。

We decided to route a parameter into a stored procedure, which executes a sql query using the parameter. 我们决定将参数路由到存储过程中,该存储过程使用该参数执行sql查询。 The other parameters use the Prompt as a friendlyname and the Name as the column name, and the program constructs a where clause from this information and passes it into the query parameter of the report. 其他参数使用Prompt作为友好名称,使用Name作为列名称,并且程序从该信息构造一个where子句,并将其传递到报表的查询参数中。 It's not a perfect solution, but we've closed all holes for injection we could and it works. 这不是一个完美的解决方案,但是我们已经关闭了所有可能的注射孔,并且可以正常工作。 Sometimes you've got to be happy with that. 有时您必须对此感到满意。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM