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

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


dhyton_1

Recommended Posts

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>

 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

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


- Data Adapter Setting Sample
w20211205_json_dataadapter.png.4f93b748af088e32539ae65a0dfeb096.png


- Report Preview
w20211205_json_preview.png.9f47423f28c628c42acc8408379c3537.png

 

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

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

 

I hope this is useful to you.

 

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