Variable columns for days in month

I'm new in Jasper Reports and I need some help. To address my problem, I've created this example.

Imagine I have a report that shows amount of sales for EACH DAY IN MONTH, GROUPED BY COUNTRY(it's important).

What is the best way to solve this problem? At this point I've tried using crosstab and got  this result this result 

forks-and-spoons.jrxml

forks-and-spoons.sql

There are 2 problems here:

  1. Datasets have no relation, and both countries' crosstabs shows same result. Maybe I can pass country as a parameter to the subDataSet?

  2. There is no days in report that has no corresponding records in items_sales table. I can generate records with null amount for days, that is not in the dataset. And I'm ok with it, if report will work fine.

  3. Layout problem. Country name cell in group header and crosstab have different width.

Also I've tried another approach: add fields and columns for each day in month, and hide 31,30,29 depending on specific month. But I've gotten layout problems. Here is report file with fixed layout: forks-and-spoons-fixed.jrxml.

How to address such problem? What is the best way to solve this problem?

recoverix's picture
Joined: Apr 30 2020 - 3:43am
Last seen: 6 months 1 week ago

1 Answer:

Eventually my problem related to this https://community.jaspersoft.com/questions/532888/crosstabs-groupings-pl.... But I don't understand the solution.

recoverix's picture
Joined: Apr 30 2020 - 3:43am
Last seen: 6 months 1 week ago
Feedback