views:

31

answers:

1

Hello, i have a problem of creating 1 group that "spand" over multiple colums in dynamicJasper. Example would be something like this:

i get data from base, which i can not change:

id1      id2       id3         id4     id5

1       Vega    Steve      8,000.23    yes

1       Vega    Steve      3,465.33    yes

2       Minson  Mark     123,987.23    no

2       Minson  Mark       3,465.33    yes

5       Lucky   Luck   3,123,465.33    no

after grouping over first 3 columns report would look like this:

id1      id2       id3         id4     id5

1       Vega    Steve      8,000.23    yes

                           3,465.33    yes

2       Minson  Mark     123,987.23    no

                           3,465.33    yes

5       Lucky   Luck   3,123,465.33    no

Is this possible to achieve in dynamicJasper?

A: 

yes its possible.

You can generate a group by a report.

GroupBuilder gb = new GroupBuilder(); DJGroup g = gb.setCriteriaColumn((PropertyColumn) columnname) .setGroupLayout(GroupLayout.VALUE_IN_HEADER) .build(); .firstReport.addGroup(g);

you can add multiple groups.

create the same code for next column. and please add it in the order of there grouping level. like first add company, then department and then designation.

Zeel
Thank you for posting, but this is not satisfactory solution. With your code, you still get multiple groups, 1 group per column. I want to all three columns "act" as 1 group. If you change any value out of three columns, new group is created. In fact one solution is that i can concatenate all columns into 1, but then i have problem with header column names and styles which must be appropriately displayed)
NubAtar