add filtering handling to base report and base template

@jgeskens and @nielsvanoch can you please review?