简体   繁体   English

根据CSV等渲染选项运行SSRS数据集

[英]Run The SSRS Dataset based on the rendering options like CSV

I have two different datasets in SSRS report which gives different outputs. 我在SSRS报告中有两个不同的数据集,它们提供了不同的输出。 I have used one dataset for summarized information (ie Chart) and other is used for actual data (Table). 我使用了一个数据集作为汇总信息(即图表),而另一个数据集用于实际数据(表格)。

1) Chart will display output at the time of report execution. 1)图表将在报告执行时显示输出。 2) Table should execute only when the report renders into CSV. 2)只有在报表转为CSV格式时,表格才应执行。

Requirement: I need to execute the one dataset SP at report run time. 要求:我需要在报表运行时执行一个数据集SP。 Other Dataset SP should not Execute when the report is running it should run only when the report rendering into CSV format 其他数据集SP不应在报表运行时执行,而应仅在将报表呈现为CSV格式时运行

Example: Dataset1 executes Sp1 Dataset2 executes Sp2 示例:Dataset1执行Sp1 Dataset2执行Sp2

Chart uses Sp1 and Table uses Sp2 图表使用Sp1,表格使用Sp2

Normally while executing report Chart will display output. 通常,在执行报告时,Chart将显示输出。 But SP1 and SP2 are executing at the same time.so report takes more time to display output. 但是SP1和SP2是同时执行的,因此报表需要更多时间来显示输出。

So I need to restrict the Actual data dataset when we running the report. 因此,在运行报告时,我需要限制“实际数据”数据集。

There is no way to create a conditional Dataset based on Globals!RenderFormat.Name and let reporting services handle it automatically 无法基于Globals!RenderFormat.Name创建条件数据集并让报表服务自动处理它

The only alternatives to your question: 您问题的唯一替代方案:

Use SP2 as a common dataset in order to save SP1 execution time and let reporting services summarize the data in the chart 使用SP2作为通用数据集,以节省SP1执行时间,并让报告服务汇总图表中的数据

OR 要么

Insert a format variable with 2 values (eg. 1. Chart, 2. Table for CSV) and let the user choose the right one before running the report. 插入具有2个值的格式变量(例如1.图表,2。CSV表),并让用户在运行报告之前选择正确的一个。 Use an Iif condition to control dataset execution egfor the chart 使用Iif条件控制数据集的执行,例如图表
= Iif( Parameters!Format.value=1, "SP1 @run=1", "SP1 @run=0")

Note that this requires adding a parameter to your stored procedures and use them to control the execution of the query 请注意,这需要向存储过程中添加一个参数,并使用它们来控制查询的执行

SELECT ...
FROM ...
WHERE ...
@run = 1

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

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