[reports] Refactor code.
[testing] User parametrized tests for reports views.