简体   繁体   中英

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. 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).

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. 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

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.

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.

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...

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.

"IN" clause limitation in Sql Server

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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