The Search field on Interactive Reports (IR) and Grids (IG) depends on the Filter settings of the columns of those reports/grids.
That does make sense, since a filter is created by Apex when you perform a search.
This did catch me out recently however, when an Interactive Report always showed all rows, regardless of the term you searched for.
Turned out that if all the report columns have their "Enable Users To Filter" option set to No, then all rows are shown.
Which is sort of logical, since the search cannot be actually performed, but I would have expected 0 rows in that case. Anyway, search is broken either way, so that's something to look out for.
This setup is shown in the "IR - Filter disabled (all)" region below.
In the example below, I have shown 3 scenarios for both Interactive Reports and Grids.
- Filter enabled (all): all columns have their "Enable Users To Filter" option set to Yes, which is what you would normally do.
- Note that for Interactive Grids, this option is called "Column Filter".
- IR and IG: Searching for "analyst" returns 2 rows as expected.
- Filter disabled (all): all columns have their "Enable Users To Filter" option set to No.
- IR: Searching for "analyst" returns all rows, which was my original issue.
- IG: Searching for "analyst" returns all rows, same as the IR. Noce that you can try to perform a search, but it does not actual execute a search because all column have "Column Filter" set to No. So I also couldn't add a default Filter for this IG for the same reason.
- For both IR and IG, it would have been nice if the Search Field was hidden - or if the Apex Build UI would have given a warning/error when building the page.
- Filter disabled (Job): only the Job column has its "Enable Users To Filter" option set to No, the other columns are set to Yes.
- IR and IG: Searching for "analyst" returns 0 rows as expected.
- Technically this is correct because the Job column cannot be searched. Searching for e.g. "Smith" does return a result because the other columns can be searched. For the user this would be a confusing situation however, so you probably don't want this in real life.