How to add a json array to a table using java so that I can pass cookies?

Viewed 2572

I have json object like this

{
  "data":[
    {
       "no":1,
       "name" : "yuda",
       "address" : "surabaya"
    },
    {
        "no":2,
        "name":"adi",
        "address":"jakarta"
    }
  ],
  "comp_name":"TEST CORP",
  "title":"Company employee",
  "status":"success"
}

I serve that json with http rest API and I want to create report with jasper report and I have success if I pass it as an url JsonQueryExecuterFactory.JSON_SOURCE.

enter image description here

enter image description here

My problem is that I can't include session cookie in JSON_SOURCE, the solution I'm trying is to create a http request in java code and then include it with JsonQueryExecuterFactory.JSON_INPUT_STREAM, but it's not working, it just shows blank page. Even though I update parameter from $P{net.sf.jasperreports.json.source} to $P{JSON_INPUT_STREAM} it doesn't work.

2 Answers
Related