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

How to make grouping in jasper table? My group is incorrect. Support Needed


makushatnik

Recommended Posts

Hi,

I write simple reports in Jaspersoft Studio for Eclipse.

I need to do a big hard report for now. In my report I have some static texts and 3 jasper tables with separate Dataset. DataSource - Json.

I was added a Group (Group is the name) section in my Info Dataset. I also was added a GroupHeader band in my table.

Json - 1-level array (not grouped) of data like this: [ { operation: "Group 1 Name", group: null, ..}, { operation: "Element 1 Name", group: "Group 1 Name",..} ..]. I want to print GroupHeader then group field = null.

Like you can see on my screen, groups are printed twice. In my DataSource I have 13 elements with 5 groups. In my result pdf I get 18 elements (because groups printed twice).

What I must change to avoid this behavior?

printform_incorrect_grouping3.jpg.225f67c97bfd1c89894e35c01ed95b59.jpg5

printform_incorrect_grouping.jpg.51c1d2551dfa92a8b427dbafa216c38e.jpg

printform_incorrect_grouping3.jpg.90e38391563b2149b90ce1b95e5d1888.jpg

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Hi Mr. Makushatnik,

do you mean like rendering 1 row consist of grouping data only then render its group data detail below it till next group and repeat?
if so, ive done similiar case with table element.
i use column header band (column name), group header band (grouping), and detail band (other column data).
i merge all cell in group header band and put the grouping query data render there while the other column data in detail band.

example i query person group by city, preview will be :
NAME     AGE     GENDER
newyork
A     45     male
B     30     male
los angeles
C     25    female
D     55    male

hope that helps. cheer!

regards,

TV

Link to comment
Share on other sites

Hi,

Thanks for your answer.

I started to do like you said. It removes duplicates in element's section, but I still have duplicate string in groupHeader band and in this section I can't see my added in Json structure and in jasper table fields - groupName.

That's my report for now (I used him like a subreport for a bigger report):

powers.jrxml

Can somebody tell me, what is wrong? 

Link to comment
Share on other sites

I have a Json like this:

{
    "info": [
        {
            "group": "Все события",
            "groupName": "Все события",
            "operation": "Все события",
            "sms": null,
            "email": null,
            "dbo": null,
            "phone": "",
            "condition": null
        },
        {
            "group": "Системные события",
            "groupName": "Системные события",
            "operation": "Системные события",
            "sms": true,
            "email": false,
            "dbo": true,
            "phone": "",
            "condition": null
        },
        {
            "group": "Системные события",
            "groupName": null,
            "operation": "Вход в систему",
            "sms": true,
            "email": false,
            "dbo": true,
            "phone": "+79635214478",
            "condition": null
        },
        {
            "group": "Системные события",
            "groupName": null,
            "operation": "Cмена пароля",
            "sms": true,
            "email": false,
            "dbo": false,
            "phone": "+79635214478",
            "condition": null
        },
        {
            "group": "Договор ДБО",
            "groupName": "Договор ДБО",
            "operation": "Договор ДБО",
            "sms": true,
            "email": false,
            "dbo": true,
            "phone": "",
            "condition": null
        },
        {
            "group": "Договор ДБО",
            "groupName": null,
            "operation": "Выпуск сертификата",
            "sms": true,
            "email": false,
            "dbo": true,
            "phone": "+79635214321",
            "condition": null
        },
        {
            "group": "Договор ДБО",
            "groupName": null,
            "operation": "Предупреждение об истечении срока сертификата",
            "sms": true,
            "email": false,
            "dbo": true,
            "phone": "+79635214321",
            "condition": null
        }
    ],
    ...
}

 

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