Scroll

Server Event: Remove blank filters from report

Attach this server event to a report to automatically remove any blank filters upon execution. Since the default behavior for blank filters is to return an empty set of data (causing No Data Qualified), this server event allows users to leave filters blank without affecting the report data.

Namespaces:

  • WebReports.Api.Reports

Code

// get report filters
ReportFilterCollection filters = sessionInfo.Report.ExecFilters;

// loop through filters
for (int i = 0; i < filters.Count; i++)
{
Filter filter = filters[i];

// if filter is blank, remove it
if (filter.Value.Length == 0)
{
filters.RemoveAt(i);
i--;
}
}

// continue execution
return null;

Hidden Article Information

Article Author
Exago Development
created 2017-05-22 21:10:24 UTC
updated 2017-06-19 17:54:48 UTC

Labels
filters, filter, SAE, server event, events, example, empty, no data qualified,
Have more questions? Submit a request