简体   繁体   中英

SSRS report to show all rows on load and then filter based on multi-value text paramater

I have created an SSRS report that renders a table from my DB. I have created a multi-value text parameter. I know I can use the parameter three ways:

  • use it in the dataset query ( WHERE col1 IN (@parm) )
  • use it in the dataset filter ( Expression = col1 , Operator = In , Value = @parm )
  • use it in the Tablix filter

The issue is that when I do this, on the initial page/report load there are no rows rendered and I have to enter something in the mult-value text parameter and re-run the report.

How can I get it to show all rows/records when the the parameter is empty and then only the matching rows otherwise.

在数据集中传递一些默认值,以便在页面加载时,报表将针对这些默认值呈现,并且不会要求您首次传递任何值。

You can either

  1. set the default values on the your parameter to the same query as the available values (ie it will select all members)
  2. update your dataset query to something like WHERE (col1 IN(@parm) OR ISNULL(@parm,'')='')

The first option is heavier on resource, the second option is preferable but you may have to update the parameter properties to allow blanks/NULL and a blank default value for it.

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