简体   繁体   中英

SSRS Row Visibility Expression

I have a report that has two date parameters (StartDate and StartInMarketDate). In some cases, the StartInMarketDate value is the database can be NULL. When either both parameters are NULL or the StartInMarketDate parameter is NULL, all records should appear on the report. When a date is given for the StartInMarketDate parameter and the StartDate is NULL, the report should exclude all records where the StartInMarketDate is NULL.

I assume I should be able to resolve this issue hiding rows based on an expression, but I cannot get the correct syntax.

Below is the syntax I came up with, but it includes all the records when I enter the StartInMarketDate parameter, and excludes the correct records when I use the StartDate parameter.

=IIF(IsNothing(Parameters!StartInMarketDate.Value), IIF(IsNothing(Fields!StartInMarketDate.Value), IIF(IsNothing(Parameters!StartDate.Value), False, True), False), False)

Any suggestions on where I'm going wrong is appreciated.

Thanks.

I think you have the Hidden expression backwards - the value should be TRUE when it should Hide the row, not Show it.

Your expression seems a little too complicated. According to your criteria, you only want to exclude rows:

When a date is given for StartInMarketDate parameter and the StartDate is NULL ... exclude all records where the StartInMarketDate field is NULL.

=IIF(NOT IsNothing(Parameters!StartInMarketDate.Value) AND IsNothing(Parameters!StartDate.Value) AND IsNothing(Fields!StartInMarketDate.Value), TRUE, FALSE)

Is there somewhere where you want to filter where the StartInMarketDate date field matches the StartInMarketDate parameter?

If you want to use an expression, remember that you are setting the Hidden property, not a visible property. If you look at the outer IIF you have basically said IF StartInMarketDate is NOT empty then set Hidden to False (showing them all).

Basically True = Hide; False = Show.

You might just need to swap all your True/False around.

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