Added support for aggregate queries and reporting (crosstab)