简体   繁体   中英

SSRS - Cannot get report rows to highlight that match the values selected in multi-value parameter

I have a SSRS report that will show all entries for a specific case where multiple parameter values from different parameters are available.

Example: Results show in the report for cases that have a...

  • Create Date between Start Date parameter and End Date parameter

  • Include at least one Area Group entry chosen from the Area Group parameter

NOTE: If a case has multiple row entries in the DB table that include Area Group A, B, C and D.... AND.... just Area Groups A and B were selected in the Area Group parameter, all Area Group row entries will show in the report for that case regardless of Area Group parameter selections chosen. This is the desired report return... to return cases that have Area Groups A and B entries.

NOW... the problem. We need to have the Area Group row entries highlighted in the report that match the Area Group parameter selections.

Example: If Area Groups A and B are selected in the Area Group parameter, highlight any row in the report that has an entry for Area Group A or B and keep any row in the report for Area Group C or D transparent/No Color (See link below for desired report ouput).

Desired Report Output

在此处输入图像描述

I have tried the following expressions for row fill and textbox fill and each either highlight any row with Area Group A only.... or.... they highlight no entries.

=IIf(InStr(Join(Parameters.AREAGROUP,Value, ","). Fields,AreaGroup,Value) > 0, "Yellow", "No Color")

=IIf(Fields.AreaGroup.Value = Parameters,AREAGROUP,Value, "Yellow", "No Color")

=IIf(InStr(Join(Parameters.AREAGROUP,Value, ","). ReportItems,AreaGroup,Value) > 0, "Yellow", "No Color")

I'm running out of ideas. Any guidance on this one would be extremely appreciated. Thanks in advance!

OK..... I solved my own problem.

Initially, I used this expression for the row fill expression.

=IIF(InStr(Join(Parameters.AREAGROUP,Value, ","). Fields,AreaGroup,Value) > 0, "Yellow", "No Color")

Thinking about the issue, I added a numeric true/false (ie 1, 0) test to the expression. The resultant expression is below. Once I put this in place, the correct rows began to highlight yellow in the report.

=IIF(IIF(InStr(Join(Parameters.AREAGROUP,Value, ","). Fields,AreaGroup,Value) > 0,1,0) = 1, "Yellow", "No Color")

Hope this helps someone in the future. Thanks all for responding!

Another, slightly cleaner way would be to do this...

=IIF(JOIN(Parameters!AREAGROUP.Value).Contains(Fields!AreaGroup.Value), "Yellow", Nothing)

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