rewrite report functionality