We have no proven recipe to do it. But it seems using groovy-datasets you can fill the cells in the way you want. Note, YARG does not provide an ability to merge cells in the output document.
In the platform version 6.8 we have added means to generate crosstab reports. But we have not announced this feature yet. See https://youtrack.cuba-platform.com/issue/PL-9865. Download the attached to the YouTrack ticket report and use it in the Timesheets sample.