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

I can't access to all json data


d7omz1996

Recommended Posts

Hello

I'm using Jaspersoft Studio and I want to create a report by using Json as datasource,

This example of my json structrue for firt two node a1 and a2:_

{    "a1": {        "a1_1": 5127,        "a1_2": "fg af ag g",        "a1_3": "gaf gaer ",        "a1_4": "142",        "a1_5": "2020-02-25T21:00:00.000+0000",        "a1_6": "2020-11-05T21:00:00.000+0000",        "a1_7": {            "a1_7.1": "4",            "a1_7.2": "arew",            "a1_7.3": "jgfh",            "a1_7.4": "rtwer",            "a1_7.5": "fsfs"        }    },    "a2": [        {            "a2_1": 5127,            "a2_2": "lab lab lab.",            "a2_3": "Good",            "a2_4": "2020-02-25T21:00:00.000+0000",            "a2_5": "2020-11-05T21:00:00.000+0000",            "a2_6": "2020-02-25T21:00:00.000+0000",            "a2_7": "SA",            "assignmentWithRolesHttpBodies": [                {                    "a2_1.1": 145,                    "a2_2.1": "lab lab lab.",                    "a2_3.1": "Good",                    "a2_4.1": "2020-02-25T21:00:00.000+0000",                    "a2_5.1": "2020-11-05T21:00:00.000+0000",                    "a2_6.1": "2020-02-25T21:00:00.000+0000",                    "a2_7.1": "KSA"                },                {                    "a2_1.2": 146,                    "a2_2.2": "lab lab lab.",                    "a2_3.2": "Good",                    "a2_4.2": "2020-02-25T21:00:00.000+0000",                    "a2_5.2": "2020-11-05T21:00:00.000+0000",                    "a2_6.2": "2020-02-25T21:00:00.000+0000",                    "a2_7.2": "India"                },                {                    "a2_1.3": 147,                    "a2_2.3": "lab lab lab.",                    "a2_3.3": "very Good",                    "a2_4.3": "2020-02-25T21:00:00.000+0000",                    "a2_5.3": "2020-11-05T21:00:00.000+0000",                    "a2_6.3": "2020-02-25T21:00:00.000+0000",                    "a2_7.3": "UAE"                },                {                    "a2_1.4": 148,                    "a2_2.4": "lab lab lab.",                    "a2_3.4": "Good",                    "a2_4.4": "2020-02-25T21:00:00.000+0000",                    "a2_5.4": "2020-11-05T21:00:00.000+0000",                    "a2_6.4": "2020-02-25T21:00:00.000+0000",                    "a2_7.4": "US"                },                {                    "a2_1.5": 149,                    "a2_2.5": "lab lab lab.",                    "a2_3.5": "Good",                    "a2_4.5": "2020-02-25T21:00:00.000+0000",                    "a2_5.5": "2020-11-05T21:00:00.000+0000",                    "a2_6.5": "2020-02-25T21:00:00.000+0000",                    "a2_7.5": "India"                }            ]        }    ]    }[/code]

 

___________________________________

So, the json is contained multi node and I can't access to two node (a1, a2) in one report data set so I tried to make subreport using same data adapter  to  let subreport print a2 data in main report which has the a1 data.  and the subreport work individually very well but not reflected in the main!!

if you know the ptoblemthe why subreport cannot be reflected in the main !! this is the code in the 

-Main report 

            <subreport>                <reportElement x="36" y="13" width="254" height="200" uuid="6156be9a-2e27-478d-bd32-6f28f9b22389"/>                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>                <subreportExpression><![CDATA["repo/Blank_A4.jasper"]]></subreportExpression>            </subreport>[/code]


Thank you for reading,, Please help if you can..

Link to comment
Share on other sites

  • Replies 6
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I want to be able to access to all the value in the json file as field I can place the fild wherever I want,
I did't try Parameebters. becuse I do not know how to use it in Json way.
I tried Create Dataset but when I use the Field of the new dataset the error message "You drop an object ........."

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