Jump to content
Changes to the Jaspersoft community edition download ×

Is thare a easy way to merge cells


grzewal

Recommended Posts

Hi!

 

I was wondering if anyone could tip me on solving a problem like this:

 

I have a report which (in simplified version) looks like this:

 

---------------

|col_1|col_2|

---------------

|val11|val12|

---------------

|val21|val22|

---------------

|val31|val32|

---------------

 

Data is sorted by col_1 values. The case is that values in col_1 are not unique. For identical values in col_1 I'd like to make the report lok like that:

 

---------------

|col_1 |col_2|

---------------

|empty|val12|

| val_1|-------

|empty|val22|

---------------

|val31 |val32|

---------------

 

which means that empty is really empty, col_1 values are vertically aligned to the middle and what's most important - there is one border per merged col_1 fields. If it weren't for the border I could use Print repeated values attribute set to false, but the report would look like that:

 

---------------

|col_1 |col_2|

---------------

|val_1 |val12|

---------------

|empty|val22|

---------------

|val31 |val32|

---------------

 

 

I must mention that the number of columns is static (which if I understand right prevents me from using a crosstab).

 

Any help would be appreciated!

 

Kind regards,

Grzewal

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

A static number of columns does not prevent you from using a crosstab. You can create one or more dummy (constant bucket expression) column groups and use the group total headers/cells as column headers/table cells.

 

Another option would be to use a subreport for the col_2 values and set stretchType="RelativeToBandHeight" and verticalAlignment="Middle" for the val_1 text field. The drawback is that you'd need to somehow send the col_2 value list to the subreport.

 

Regards,

Lucian

Link to comment
Share on other sites

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...