Why would a jsonql query work with jasperreports but not in JasperStudio

0

In Studio, I have created a simple JSONQL report that works in JasperReports but in Studio the field renders as null. What am I doing wroing or is there a bug?

(The field in studio renders as null in the report preview and in the Dataset and Query Dialog Data Preview)

have the following JSON that I am using in a JSON data adapter with JSONQL as the query language

{
  "data": {
    "common": {
      "data": [{
        "projectNameLabel": "XXXX",
      }]
    }
}

The report has the following query string

    <queryString language="jsonql">
        <![CDATA[data.common.data[0]]]>
    </queryString>

and my detail band had only one field

    <textField>
                <reportElement x="100" y="2" width="200" height="16" uuid="314a40d0-7a2e-49bf-a877-6cbce9de124e">
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                </reportElement>
                <textFieldExpression><![CDATA[$F{projectNameLabel}]]></textFieldExpression>
            </textField>

 

dhyton_1's picture
Joined: Aug 15 2018 - 5:31am
Last seen: 6 days 3 hours ago

1 Answer:

0

Perhaps the DataAdapter is not configured properly.
Try to specify 'Select Expression'.


- Data Adapter Setting Sample


- Report Preview

 

- I made a few edits to the json file for testing.

[    
{
  "data": {
    "common": {
      "data": [{
        "projectNameLabel": "XXXX"
      }]
    }
  }
}
]

I hope this is useful to you.

yama818's picture
442
Joined: Aug 17 2018 - 3:48pm
Last seen: 12 hours 5 min ago
Feedback
randomness