This is major edit from the previous version of this question, which would hold little of value for future readers anyway.
I have a report where I want to hide certain rows depending on the data in certain fields, but also be able to override this based on a parameter value.
So for my visibility (Hidden), I am using the following expression:
=iif(CDbl(ReportItems!tbOEM1.Value) >= 20 Or CDbl(ReportItems!tbOEM2.Value) >= 20 Or CDbl(ReportItems!tbOEM3.Value) >= 20 Or Parameters!OEM20.Value.Equals(False)
, False
, True
)
Which I think should mean, if any of the 3 tbOEM
fields are >= 20, then display the row. But if the user has selected False for the "OEM20" parameter (Boolean), display all the rows regardless of the values.
However, when I run the report and choose True for the OEM20 parameter, No rows get displayed, even though I know that there are rows that have OEM values over 20.
To investigate, I added a background color expression to each of the tbOEM reportitems. Here is the background color expression for tbOEM1:
=iif(CDbl(ReportItems!tbOEM1.Value) >= 20
, "Red"
, "White"
)
When I run the report with False for the OEM20 parameter, I see all rows returned, and no fields are colored Red, even the ones that should be because they are tbOEM fields with a value >=20.
So I wonder if this is an order of execution issue where the value of the ReportItem is not yet known when setting visibility and background color? Is this known and documented anywhere? I googled and couldn't find anything.
Or am I doing something else wrong that is fixable?
I already know that a workaround is to use the datafield calculations that populate the tbOEM fields in the expressions, rather than the ReportItems collection. So you needn't bother to tell me about this option.