Jump to content
We've recently updated our Privacy Statement, available here ×

Variable columns for days in month


recoverix

Recommended Posts

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?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...