简体   繁体   English

Report Builder 3.0 - 如何使用大型数据集运行此报告?

[英]Report Builder 3.0 - How can I run this report with a large data set?

I am new to developing reports with large amounts of data, so I am looking for some advice with a problem I am having.我是使用大量数据开发报告的新手,所以我正在寻找一些关于我遇到的问题的建议。

I am developing a SSRS report with 6 parameters.我正在开发一个包含 6 个参数的 SSRS 报告。 Each Parameter has its' own data set that specifies a distinct list of values for the parameters.每个参数都有自己的数据集,为参数指定一个不同的值列表。

The user will be able to choose as many values as they want for each parameter, except for 1 (the date).用户可以为每个参数选择任意数量的值,但 1(日期)除外。

The query looks something like;查询看起来像;

SELECT [CURR].[PERIOD]
,[CURR].[PERIOD_MTD]
,[CURR].[CATEGORY1]
,[CURR].[CATEGORY2]
,[CURR].[CATEGORY3]
,[CURR].[CATEGORY4]
,[CURR].[CATEGORY5]
,[CURR].[CALCULATION1_ITD]
,[CURR].[CALCULATION2_ITD]
,[CURR].[CALCULATION3_ITD]
,[CURR].[CALCULATION4_ITD]
,[CURR].[CALCULATION1_MTD]
,[CURR].[CALCULATION2_MTD]
,[CURR].[CALCULATION3_MTD]
,[CURR].[CALCULATION4_MTD]
FROM [BIG_TABLE] [CURR] LEFT OUTER JOIN
[BIG_TABLE] [PREV M]
    ON [CURR].[PERIOD_MTD] = [PREV M].[PERIOD]
    AND [CURR].[CATEGORY1] = [PREV M].[CATEGORY1]
    AND [CURR].[CATEGORY2] = [PREV M].[CATEGORY2]
    AND [CURR].[CATEGORY3] = [PREV M].[CATEGORY3]
    AND [CURR].[CATEGORY4] = [PREV M].[CATEGORY4]
    AND [CURR].[CATEGORY5] = [PREV M].[CATEGORY5]
WHERE [CURR].[PERIOD] = @YYYYMM
AND [CURR].[CATEGORY1] IN (@PARAMETER1)
AND [CURR].[CATEGORY2] IN (@PARAMETER2)
AND [CURR].[CATEGORY3] IN (@PARAMETER3)
AND [CURR].[CATEGORY4] IN (@PARAMETER4)
AND [CURR].[CATEGORY5] IN (@PARAMETER5)

This is the problem I am having;这是我遇到的问题; 1 parameter has a distinct list of over 5,500 values that the user can choose from. 1 个参数有一个包含 5,500 多个值的不同列表,用户可以从中进行选择。 When all of the values are selected, I notice that the parameter field does not populate like the others (Image below).选择所有值后,我注意到参数字段不像其他值那样填充(下图)。

参数图

When the report runs, I get the following error:报告运行时,我收到以下错误:

错误信息

This message is pretty ambiguous, but I isolated it to the fact that the report will run with fewer values in this parameter, but not all of them.此消息非常含糊,但我将其隔离为报告将在此参数中使用较少值运行的事实,但不是全部。

I am not sure what else to try.我不确定还能尝试什么。 I am thinking this may be a matter of getting a large volume a data through the main data set.我认为这可能是通过主数据集获取大量数据的问题。

Extra information:额外的信息:

Datasource is accessed with a shared connection to SharePoint通过到 SharePoint 的共享连接访问数据源

The table that is queried for this report has no indexes.为此报告查询的表没有索引。 I wonder if this is important because the table has roughly 26.5mill rows.我想知道这是否重要,因为该表大约有 26.5mill 行。

I would suggest your approach is wrong.我建议你的方法是错误的。

If you are presenting a user with a list of 5000+ items to choose from I'm guessing they would either choose small number of them or want to select all of them, it would be unlikely that they would sit there and choose 100 items from a list.如果您向用户展示一个包含 5000 多个项目的列表以供选择,我猜他们要么会选择其中的一小部分,要么想要 select 所有人,他们不太可能会坐在那里并从中选择 100 个项目一个列表。

if this is the case then I would suggest appending an "ALL" option to the list ( UNION to your original list) and then amend the query something like this...如果是这种情况,那么我建议在列表中附加一个“ALL”选项( UNION到您的原始列表中),然后像这样修改查询......

WHERE [CURR].[PERIOD] = @YYYYMM
AND (@PARAMETER1 = 'ALL' OR [CURR].[CATEGORY1] IN (@PARAMETER1))
...
...

You might want to also read these previous SO questions and MS Article.您可能还想阅读这些以前的 SO 问题和 MS 文章。

"IN" clause limitation in Sql Server Sql 服务器中的“IN”子句限制

https://docs.microsoft.com/en-us/sql/t-sql/language-elements/in-transact-sql?view=sql-server-ver15 https://docs.microsoft.com/en-us/sql/t-sql/language-elements/in-transact-sql?view=sql-server-ver15

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

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