Crosstab reports, also known as matrix reports, to show the relationships between three or more query items.
Crosstab reports show data in rows and columns with information summarized at the intersection points.
*To get a clearer idea on what this report does, please choose Client(s) and check the results.*
class CrossTabReportView(SlickReportView):
report_model = SalesLineTransaction
date_field = 'transaction_date'
group_by = 'product'
columns = ['slug', 'name']
# To activate Crosstab
crosstab_model = 'client'
# we corsstab on a foreignkey field
crosstab_columns = [SlickReportField.create(Sum, 'value', name='value__sum', verbose_name=_('Sales'))
# To be computed for each chosen entity in the crosstab.
]