Custom Reporting Data Filters
  • Updated on 09 Dec 2013
  • 1 minute to read
  • Print
  • Dark
    Light

Custom Reporting Data Filters

  • Print
  • Dark
    Light

Custom reporting data filters involve deciding which rows to include; for example, Common types filter .

Custom reporting filters are used in conjunction with custom data sources. Usually a custom report filter will apply only to a specific custom data source. This filter can be used to filter the data that is returned by the data source. Below is a sample of a filter that is used to filter the "thing" column of the sample data source we have created here: Custom Reporting Data Sources .

To begin, create a class that inherits from and implements AbstractCustomFilter . You will also need to decorate your class with the AutoRegisterReportElement attribute to get it to show up in the Decisions Report Designer .

Below are sample code snippets showing how to implement the two methods from AbstractCustomFilter .

The Applies method returns a bool that specifies whether or not this report filter should show up as a selectable filter in the report designer. If your filter applies only to a specific data source, this is where you will specify that restriction:

 public override bool Applies(ReportDefinition definition)
{
    if (definition.UsesCustomDataSource())
    {
        foreach (ICustomReportDataSource dataSource in definition.GetCustomDataSources())
        {
            if (dataSource is SampleCustomDataSource)
            {
                return true;
            }
        }
    }
    return false;
}
Was this article helpful?