Jump to content
Changes to the Jaspersoft community edition download ×

narcism

Members
  • Posts

    319
  • Joined

  • Last visited

Community Answers

  1. narcism's post in Getting last element from array with jsonql was marked as the answer   
    The only place you could use negative indexes is inside an "Array Slice" expression. In your case that would mean having:
    <field name="street1a" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="person.addresses.*[-1:].street1"/></field>[/code] 
  2. narcism's post in table view was marked as the answer   
    The table interactivity does not work for columns with detail cells that have complex textField expressions.
    For columns that format dates/numbers you could move the pattern at the textField level and choose Blank When NULL  in the textField properties. This way you could only reference the textField in the expression and have the interactivity on for that column. 
  3. narcism's post in JSON ARRAY JSON Data source displaying null values was marked as the answer   
    With JSON you need to change the field expression from "[0]" to ".", like so:
    <field name="FirmReferenceNumber" class="java.lang.String"> <property name="net.sf.jasperreports.json.field.expression" value="."/> <fieldDescription><![CDATA[FirmReferenceNumber]]></fieldDescription></field>[/code] 
  4. narcism's post in jaspersoft studio 6.12 JSONQL JSONArray issue with charcter - was marked as the answer   
    This is not a bug. The "AB-CDEF" in "DataItem.AB-CDEF" is not a valid object key in JSONQL, so it needs to be wrapped in quotes and square brackets:
    <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("DataItem["AB-CDEF"].GroupData.OGF.FRN")]]></dataSourceExpression>[/code]There are more details in the JSONQL description page here: http://jasperreports.sourceforge.net/sample.reference/jsonqldatasource/index.html#jsonql
  5. narcism's post in xpath // with json? was marked as the answer   
    You need to set the query language to JSONQL/jsonql for "..name" or "$..name" to work.
    This also needs to be matched with the proper field expression like so:
    <queryString language="jsonql"> <![CDATA[..name]]></queryString><field name="name" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> <fieldDescription><![CDATA[The name]]></fieldDescription></field>[/code]This is a special case where the query returns only the leaf nodes of the JSON tree, hence the weird expression. However, if you had "..customer" as your main query, you could use <property name="net.sf.jasperreports.jsonql.field.expression" value="name"/> for your field.
  6. narcism's post in Problem with JSON dataset was marked as the answer   
    I'm posting only the relevant part, the query and the field mappings:
    <queryString language="jsonql"> <![CDATA[list.*]]></queryString><field name="keyA" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="keyA"/> <fieldDescription><![CDATA[keyA]]></fieldDescription></field><field name="keyB" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="keyB"/> <fieldDescription><![CDATA[keyB]]></fieldDescription></field><field name="keyC" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="keyC"/> <fieldDescription><![CDATA[keyC]]></fieldDescription></field><field name="Title" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.title"/> <fieldDescription><![CDATA[Title]]></fieldDescription></field><field name="Author" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.AUTHOR"/> <fieldDescription><![CDATA[Author]]></fieldDescription></field><field name="Date" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.DATE"/> <fieldDescription><![CDATA[Date]]></fieldDescription></field>[/code]Some notes:
    1. If you manually change the query language, from JSON to JSONQL, you also need to adjust the field-level properties to use the proper name: net.sf.jasperreports.jsonql.field.expression
    2. JSON/JSONQL expressions are case sensitive
    3. The JSONQL expression "^{2}.title" implies going up 2 levels from whatever your main query item points to, then select "title"
    4. If your JSON data is part of a bigger JSON tree, then you need to adjust your main query expression from "list.*" to "..list.*" which will look for the "list" key anywhere in the JSON tree
  7. narcism's post in How to toggle Report Pagination with visualize.js? was marked as the answer   
    In this case, the ignorePagination property is read-only, so once set, it cannot be changed unless you completely rerun the report. I've altered your fiddle here: jsfiddle.
    In essence, I destroy the previous instance and then reset the report reference to the new one with the ignorePagination according to the checkbox.
  8. narcism's post in JSON Query problem was marked as the answer   
    If you are able to switch to JSONQL language, you could use a query like: *(id == "bugcorrection")
    The original JSON language is very limited in terms of tree traversal and is meant to be replaced by JSONQL.
  9. narcism's post in JSON Array as table was marked as the answer   
    The horizontal display can be achieved like this with lists:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.9.0.final using JasperReports Library version 6.9.0-cb8f9004be492ccc537180b49c026951f4220bf3 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report_v1" pageWidth="595" pageHeight="842" columnWidth="90" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="86523aef-3262-499e-ae57-66e5dabd4218"> <subDataset name="ListDataSet" uuid="fb812d2a-cb63-473c-b7d3-149977476dd0"> <field name="val" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> </field> </subDataset> <queryString language="jsonql"> <![CDATA[]]> </queryString> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="180" y="20" width="200" height="30" uuid="4014c1c1-e6a1-4d22-a50f-6cedeac55ead"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14"/> </textElement> <text><![CDATA[Horizontal Display]]></text> </staticText> </band> </title> <pageHeader> <band height="30" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="30"> <staticText> <reportElement mode="Opaque" x="360" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="ec8aaa95-0f7b-42cf-b858-eca1c1f6938d"/> <text><![CDATA[Remark]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="180" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="645a5553-e3bd-4949-92a9-a56ab0f4f31e"/> <text><![CDATA[Fax]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="0" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="82279926-fcc9-4111-a8ba-d215eddc5b18"/> <text><![CDATA[Name]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="90" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="243d1437-6676-49de-bb75-1f3341716646"/> <text><![CDATA[Tel]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="270" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="50b884d0-5d0f-40e7-ab35-e6f26f870ca6"/> <text><![CDATA[Address]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <componentElement> <reportElement x="0" y="0" width="450" height="30" uuid="887dc258-2eac-4492-ae69-f9b2ffd1faee"> <property name="com.jaspersoft.studio.unit.CONTENTS.width" value="px"/> </reportElement> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Horizontal"> <datasetRun subDataset="ListDataSet" uuid="1316cfd7-fe59-440f-a155-501914c00056"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)($P{REPORT_DATA_SOURCE})).subDataSource()]]></dataSourceExpression> </datasetRun> <jr:listContents height="30" width="90"> <textField> <reportElement x="0" y="0" width="90" height="30" uuid="4ee2d6b3-c681-433f-a170-4bb31697de58"/> <textFieldExpression><![CDATA[$F{val}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> </band> </detail> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>The preview:

    The vertical display can be done this way, with nested lists:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.9.0.final using JasperReports Library version 6.9.0-cb8f9004be492ccc537180b49c026951f4220bf3 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report_v2" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="90" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="86523aef-3262-499e-ae57-66e5dabd4218"> <subDataset name="HorizontalListDataSet" uuid="fb812d2a-cb63-473c-b7d3-149977476dd0"/> <subDataset name="VerticalListDataSet" uuid="86686d59-46df-43f1-b2bf-82998d8569be"> <field name="val" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> </field> </subDataset> <queryString language="jsonql"> <![CDATA[]]> </queryString> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="180" y="20" width="200" height="30" uuid="4014c1c1-e6a1-4d22-a50f-6cedeac55ead"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14"/> </textElement> <text><![CDATA[Vertical Display]]></text> </staticText> </band> </title> <pageHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement mode="Opaque" x="90" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="243d1437-6676-49de-bb75-1f3341716646"/> <text><![CDATA[Tel]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="0" y="0" width="90" height="30" backcolor="#9AF5E1" uuid="82279926-fcc9-4111-a8ba-d215eddc5b18"> <property name="com.jaspersoft.studio.unit.leftIndent" value="px"/> <property name="com.jaspersoft.studio.unit.spacingBefore" value="pixel"/> </reportElement> <textElement> <paragraph leftIndent="0"/> </textElement> <text><![CDATA[Name]]></text> </staticText> </band> </pageHeader> <summary> <band height="50"> <componentElement> <reportElement x="0" y="0" width="180" height="30" uuid="887dc258-2eac-4492-ae69-f9b2ffd1faee"> <property name="com.jaspersoft.studio.unit.CONTENTS.width" value="px"/> </reportElement> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Horizontal"> <datasetRun subDataset="HorizontalListDataSet" uuid="1316cfd7-fe59-440f-a155-501914c00056"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)($P{REPORT_DATA_SOURCE})).subDataSource("^")]]></dataSourceExpression> </datasetRun> <jr:listContents height="30" width="90"> <componentElement> <reportElement x="0" y="0" width="90" height="30" uuid="3ba51777-567a-495e-b631-ac03510fdbb0"/> <jr:list printOrder="Vertical"> <datasetRun subDataset="VerticalListDataSet" uuid="c4c4534b-2081-4903-84f2-42621c022a3c"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)($P{REPORT_DATA_SOURCE})).subDataSource()]]></dataSourceExpression> </datasetRun> <jr:listContents height="30" width="90"> <textField> <reportElement x="0" y="0" width="90" height="30" uuid="4aab6768-2a75-4d88-995a-45a9af3732d1"/> <textFieldExpression><![CDATA[$F{val}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> </jr:listContents> </jr:list> </componentElement> </band> </summary></jasperReport>The preview:

  10. narcism's post in Processing string arrays in JSON data file was marked as the answer   
    Although not obvious, you need a "[0]" expression for your field in the subreport, like so:
    <field name="multi_value" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> <fieldDescription><![CDATA[multi_value]]></fieldDescription></field>[/code]If you want to access the array values in a more concise way without using subreports, you could iterate directly over the multi_values items then travel up the JSON tree for the other values:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.8.0.final using JasperReports Library version 6.8.0-2ed8dfabb690ff337a5797129f2cd92902b0c87b --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="76779812-15b1-4e44-ad29-10e660c7e020"> <queryString language="jsonql"> <![CDATA[..multi_values.*]]> </queryString> <field name="value" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> <fieldDescription><![CDATA[Value]]></fieldDescription> </field> <field name="itemName" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.item_name"/> <fieldDescription><![CDATA[item name]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement x="277" y="0" width="278" height="30" uuid="fd4f82c2-abbe-4ef8-8eb8-91afd9db6c46"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0499f481-103c-4059-a47e-03973f8e0a26"/> </reportElement> <text><![CDATA[Value]]></text> </staticText> <staticText> <reportElement x="0" y="0" width="277" height="30" uuid="3a9080a0-6b05-4ec9-a0d3-fec572c39796"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="95758653-15a1-4f2f-818e-073c28049db5"/> </reportElement> <text><![CDATA[item Name]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="277" y="0" width="278" height="30" uuid="5241ef9c-fea3-499f-bf4a-58434d8872e2"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="0499f481-103c-4059-a47e-03973f8e0a26"/> </reportElement> <textFieldExpression><![CDATA[$F{value}]]></textFieldExpression> </textField> <textField> <reportElement x="0" y="0" width="277" height="30" uuid="baaf49be-1cd2-42f0-b8fb-948146979e58"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="95758653-15a1-4f2f-818e-073c28049db5"/> </reportElement> <textFieldExpression><![CDATA[$F{itemName}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code] 
  11. narcism's post in Problem in my interactive report was marked as the answer   
    You need to use the "Page X of Y" palette component which is a composite element made out of two textFields with different evaluationTime setting for each. After you drop the component and inspect the JRXML you should see something like this in the Source tab:
    <textField> <reportElement x="354" y="14" width="100" height="30" uuid="5fa7916e-f99d-4bdf-b28f-fc08c8ed99f8"/> <textElement textAlignment="Right"/> <textFieldExpression><![CDATA["Page " + $V{PAGE_NUMBER}]]></textFieldExpression></textField><textField evaluationTime="Report"> <reportElement x="454" y="14" width="100" height="30" uuid="84dcff42-e5e3-4309-877c-020f91153bdc"/> <textElement textAlignment="Left"/> <textFieldExpression><![CDATA[" of " + $V{PAGE_NUMBER}]]></textFieldExpression></textField>[/code]EDIT: Regarding the repeating footer issue, this happens because the crosstab ends-up in a Summary band for which the footer band does not repeat when it overflows.
    To overcome this issue, once you have added the Page Footer band with the pagination textField(s) you need to set the report property:
    Summary With Page Header And Footer to true, in the Report Properties tab, in JasperSoft Studio, or manually edit the JRXML by adding:
    isSummaryWithPageHeaderAndFooter="true" to the top-level jasperReports tag:
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" ... isSummaryWithPageHeaderAndFooter="true" ... uuid="31ce6514-6e4a-4667-a352-02d0b047a48b">[/code] 
  12. narcism's post in Jasper Studio subreport json was marked as the answer   
    Your subreport's dataSource expression needs to look like this:
    <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("cad_mod_inv")]]></dataSourceExpression>[/code]because you are already iterating items under the cad_mod key(you specified that in the the main report's query string).
  13. narcism's post in View JSON data adapter data via table was marked as the answer   
    For a basic table-like preview you can just add the fields in the main dataset and get something like:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Users" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="61928541-d006-4374-9164-985c6c4116c9"> <queryString language="JSON"> <![CDATA[]]> </queryString> <field name="id" class="java.lang.Integer"> <property name="net.sf.jasperreports.json.field.expression" value="id"/> <fieldDescription><![CDATA[id]]></fieldDescription> </field> <field name="name" class="java.lang.String"> <property name="net.sf.jasperreports.json.field.expression" value="name"/> <fieldDescription><![CDATA[name]]></fieldDescription> </field> <field name="ord" class="java.lang.Integer"> <property name="net.sf.jasperreports.json.field.expression" value="ord"/> <fieldDescription><![CDATA[ord]]></fieldDescription> </field> <field name="visible" class="java.lang.String"> <property name="net.sf.jasperreports.json.field.expression" value="visible"/> <fieldDescription><![CDATA[visible]]></fieldDescription> </field> <title> <band height="51"> <staticText> <reportElement x="180" y="0" width="200" height="30" uuid="90b36b64-6fb2-4076-ac5c-f9799d0eace1"/> <textElement textAlignment="Center" verticalAlignment="Justified"> <font size="14"/> </textElement> <text><![CDATA[basic Preview]]></text> </staticText> </band> </title> <columnHeader> <band height="30"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="120" height="30" backcolor="#C2F9FC" uuid="a4247667-3f3f-4154-9dbd-53317fa1b94d"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bd83a66d-284a-45b0-9211-3537ee4a9bb1"/> </reportElement> <text><![CDATA[id]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="120" y="0" width="120" height="30" backcolor="#C2F9FC" uuid="8f508ddb-4f4d-4b31-a39e-2899bc041aac"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="db194b8e-d7c3-4d1d-b052-8591596fdf14"/> </reportElement> <text><![CDATA[name]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="240" y="0" width="120" height="30" backcolor="#C2F9FC" uuid="8eef734b-a06f-4594-8d5f-9ff3a096d3ce"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6fe6e49e-7615-42bd-a8e4-62509007105f"/> </reportElement> <text><![CDATA[ord]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="360" y="0" width="120" height="30" backcolor="#C2F9FC" uuid="a0161638-78ff-4793-9d0e-2fe3c870f95b"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="07c87beb-832f-4b31-b437-db5ec6916e99"/> </reportElement> <text><![CDATA[visible]]></text> </staticText> </band> </columnHeader> <detail> <band height="30"> <textField> <reportElement x="0" y="0" width="120" height="30" uuid="c2d72779-0e0a-429b-aa62-6316d17bc132"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="bd83a66d-284a-45b0-9211-3537ee4a9bb1"/> </reportElement> <textFieldExpression><![CDATA[$F{id}]]></textFieldExpression> </textField> <textField> <reportElement x="120" y="0" width="120" height="30" uuid="a1847755-6bd5-476f-bfc9-699592d9a7bd"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="db194b8e-d7c3-4d1d-b052-8591596fdf14"/> </reportElement> <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression> </textField> <textField> <reportElement x="240" y="0" width="120" height="30" uuid="2c4acd56-bf85-4479-aa91-0095636faeae"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6fe6e49e-7615-42bd-a8e4-62509007105f"/> </reportElement> <textFieldExpression><![CDATA[$F{ord}]]></textFieldExpression> </textField> <textField> <reportElement x="360" y="0" width="120" height="30" uuid="e61e5e61-d93d-479f-aa8c-c166fe3e3df3"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="07c87beb-832f-4b31-b437-db5ec6916e99"/> </reportElement> <textFieldExpression><![CDATA[$F{visible}]]></textFieldExpression> </textField> </band> </detail></jasperReport>[/code]If you need to display the data in a subDataset-based element there are some additional steps you need to perform in your case. For a table-based report you could:
    1. Switch the query language to JSONQL to be able to travel up the JSON tree
    2. Set the query to select only the first element
    3. Create a subDataset with the desired fields
    4. Add a custom dataSourceExpression to your table's datasetRun that moves up the JSON tree and selects the entire array
    You should be getting something like:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Users" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="61928541-d006-4374-9164-985c6c4116c9"> <subDataset name="TableDataset" uuid="773ceda1-586c-40f8-82fd-933dad400bc5"> <field name="id" class="java.lang.Integer"> <property name="net.sf.jasperreports.jsonql.field.expression" value="id"/> <fieldDescription><![CDATA[id]]></fieldDescription> </field> <field name="name" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="name"/> <fieldDescription><![CDATA[name]]></fieldDescription> </field> <field name="ord" class="java.lang.Integer"> <property name="net.sf.jasperreports.jsonql.field.expression" value="ord"/> <fieldDescription><![CDATA[ord]]></fieldDescription> </field> <field name="visible" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="visible"/> <fieldDescription><![CDATA[visible]]></fieldDescription> </field> </subDataset> <queryString language="JSONQL"> <![CDATA[[0]]]> </queryString> <title> <band height="51"> <staticText> <reportElement x="180" y="0" width="200" height="30" uuid="90b36b64-6fb2-4076-ac5c-f9799d0eace1"/> <textElement textAlignment="Center" verticalAlignment="Justified"> <font size="14"/> </textElement> <text><![CDATA[Table Preview]]></text> </staticText> </band> </title> <columnHeader> <band height="20"/> </columnHeader> <detail> <band height="60"> <componentElement> <reportElement x="0" y="0" width="430" height="60" uuid="d7f20fb3-d6c3-42bd-91b3-e929f6af9e87"/> <jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd"> <datasetRun subDataset="TableDataset" uuid="6597a01b-64d4-4286-ae68-f70f31295f2f"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("^")]]></dataSourceExpression> </datasetRun> <jr:column width="110" uuid="9805d0a9-fcb9-4ea0-b29e-2fb73ac61cf7"> <jr:columnHeader height="30"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="110" height="30" backcolor="#C2F9FC" uuid="60409ca5-0195-41b4-803c-584434e71927"/> <text><![CDATA[id]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="110" height="30" uuid="4b178ab7-2a84-4f11-a309-2f830a20d526"/> <textFieldExpression><![CDATA[$F{id}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="100" uuid="4c82b871-dacb-4251-9036-952777d48f63"> <jr:columnHeader height="30"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="100" height="30" backcolor="#C2F9FC" uuid="cb5da1fa-a943-4abe-9b33-24d418a101fc"/> <text><![CDATA[name]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="811fd3f8-1c69-4f28-82aa-ae820e222870"/> <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="110" uuid="5e689a36-a2c3-4426-8949-e2a6ea16fd84"> <jr:columnHeader height="30"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="110" height="30" backcolor="#C2F9FC" uuid="7822f0f3-2532-4f5c-9986-9cd1113cbc50"/> <text><![CDATA[ord]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="110" height="30" uuid="9de8cef4-1fd6-4185-9f32-fc89f79defba"/> <textFieldExpression><![CDATA[$F{ord}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> <jr:column width="110" uuid="cafc6c4f-32e6-4932-872a-e7c1e07cf65e"> <jr:columnHeader height="30"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="110" height="30" backcolor="#C2F9FC" uuid="1cf010d7-f399-4c6b-a027-3696a1f4439b"/> <text><![CDATA[visible]]></text> </staticText> </jr:columnHeader> <jr:detailCell height="30"> <textField> <reportElement x="0" y="0" width="110" height="30" uuid="140206f5-fb7d-4824-8299-6cf1a8e2b5a9"/> <textFieldExpression><![CDATA[$F{visible}]]></textFieldExpression> </textField> </jr:detailCell> </jr:column> </jr:table> </componentElement> </band> </detail></jasperReport>[/code]
  14. narcism's post in Populating subreport with json datasource was marked as the answer   
    Things are not all that different between JSON/JSONQL and JDBC data sources in terms of data source processing.
    With subreports, as you might already know, it is about how the main data source relates to the subreport's data source: is it the same, just a subset or is it completely different? And these things matter because when reusing the same data source inside a subreport, it might completly exhaust it and the main report would be left without any more records to process.
    In your case the main dataset consists of 9 items from the "sitojs" array, produced by your query:
    <queryString language="json"> <![CDATA[sitojs]]></queryString> which means that the detail band will be repeated 9 times with your subreport. To fix this, you could:
    leave the main report's query empty either leave your subreport inside the detail band or move it to the summary band, and set it's dataSourceExpression to: <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("sitojs.taking_hostel")]]></dataSourceExpression>and you will get the expected result:

  15. narcism's post in How to create and run Jasper Report with JSON data passed to it via REST? was marked as the answer   
    First you should get somehow familiar with the REST API that is described here: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v710/rest-api-overview
    Based on that API, there is this Java client created by Jaspersoft: https://github.com/Jaspersoft/jrs-rest-java-client. The Readme there covers a lot of topics.
    If you're not into a Java-based solution you could use the API directly. My answer here: https://stackoverflow.com/a/37441567/5882963 covers a similar topic to yours but starts off with how to pass XML data to sample report and then how to modify the report in order to pass JSON data.
     
  16. narcism's post in Printed Json Values was marked as the answer   
    You could check out my answer here: https://stackoverflow.com/a/37441567/5882963
    It contains a sample JRXML that starts with XML data and then about JSON. In essence you need to pass the JSON data as a String parameter and then convert it to an InputStream and construct a special parameter that JasperReports picks up and fills the report:
    <parameter name="jsonString" class="java.lang.String"> <defaultValueExpression><![CDATA["{"a": [ {"b": { "val": "val1"}}, {"b": { "val": "val2" }}]}"]]></defaultValueExpression></parameter><parameter name="JSON_INPUT_STREAM" class="java.io.InputStream"> <defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{jsonString}.getBytes("UTF-8"))]]></defaultValueExpression></parameter>Edit:
    With a JSON like this:
    { "order":"000000", "valueorder":"270.00", "payment":"CRED CARD 2X", "date":"2017-03-17", "nextpayment":[ "17/03/2017", "02/05/2017" ], "valuenextpayment":[ "R$u00a0135,00", "R$u00a0135,00"]}your report would look like this:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="16882c94-641b-47b6-bd2f-675edbc1f15a"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <subDataset name="NextPaymentDateDataset" uuid="5337e69f-16e4-447d-a9e7-fbe6d25a479f"> <field name="item" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> <fieldDescription><![CDATA[The Item in the Dates Array]]></fieldDescription> </field> </subDataset> <subDataset name="NextPaymentValueDataset" uuid="5337e69f-16e4-447d-a9e7-fbe6d25a479f"> <field name="item" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="[0]"/> <fieldDescription><![CDATA[The Item in the Values Array]]></fieldDescription> </field> </subDataset> <parameter name="jsonString" class="java.lang.String"> <defaultValueExpression><![CDATA["{n" + " "order": "000000",n" + " "valueorder": "270.00",n" + " "payment": "CRED CARD 2X",n" + " "date": "2017-03-17",n" + " "nextpayment": [n" + " "17/03/2017",n" + " "02/05/2017"n" + " ],n" + " "valuenextpayment": [n" + " "R$\u00a0135,00",n" + " "R$\u00a0135,00"n" + " ]n" + "}"]]></defaultValueExpression> </parameter> <parameter name="JSON_INPUT_STREAM" class="java.io.InputStream"> <defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{jsonString}.getBytes("UTF-8"))]]></defaultValueExpression> </parameter> <queryString language="jsonql"> <![CDATA[]]> </queryString> <field name="order" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="order"/> <fieldDescription><![CDATA[order]]></fieldDescription> </field> <field name="valueorder" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="valueorder"/> <fieldDescription><![CDATA[valueorder]]></fieldDescription> </field> <field name="payment" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="payment"/> <fieldDescription><![CDATA[payment]]></fieldDescription> </field> <field name="date" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="date"/> <fieldDescription><![CDATA[date]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="180" y="20" width="200" height="30" uuid="33c1adf9-dc58-4d35-a409-72de3d4f0347"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14"/> </textElement> <text><![CDATA[unrelated JSON arrays]]></text> </staticText> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="80" height="30" backcolor="#BEFADB" uuid="5258fbf3-575f-486e-bede-26e83ec791a5"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6b5c10f8-8390-4a95-a707-2f267d64349a"/> </reportElement> <text><![CDATA[order]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="80" y="0" width="90" height="30" backcolor="#BEFADB" uuid="464a7d52-1801-4d67-9cda-c4b2d2e4526b"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a223b8db-9803-4257-baf6-cfbc758b6950"/> </reportElement> <text><![CDATA[valueorder]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="170" y="0" width="100" height="30" backcolor="#BEFADB" uuid="c179e19a-efa9-4d27-947c-84b14d2639aa"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="166b5682-4aab-4c8a-b7d3-4e7b4be84db6"/> </reportElement> <text><![CDATA[payment]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="270" y="0" width="80" height="30" backcolor="#BEFADB" uuid="cb1829b9-c782-42a7-a3f4-0126db20cc6a"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[order date]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="350" y="0" width="100" height="30" backcolor="#BEFADB" uuid="628c20fa-bbc9-43ea-8aa4-1486bf518e38"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[next payment date]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="450" y="0" width="100" height="30" backcolor="#BEFADB" uuid="2b4c49a7-1984-48d4-aa92-9a6d859feda8"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[next payment value]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="30" uuid="27c8ae6d-def5-4abd-b691-d350fd92c719"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6b5c10f8-8390-4a95-a707-2f267d64349a"/> </reportElement> <textFieldExpression><![CDATA[$F{order}]]></textFieldExpression> </textField> <textField> <reportElement x="80" y="0" width="90" height="30" uuid="94342e9b-d545-441c-9350-9179e4cc2530"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a223b8db-9803-4257-baf6-cfbc758b6950"/> </reportElement> <textFieldExpression><![CDATA[$F{valueorder}]]></textFieldExpression> </textField> <textField> <reportElement x="170" y="0" width="100" height="30" uuid="8e5286de-d8ac-43a5-bc70-936d3b59db7d"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="166b5682-4aab-4c8a-b7d3-4e7b4be84db6"/> </reportElement> <textFieldExpression><![CDATA[$F{payment}]]></textFieldExpression> </textField> <textField> <reportElement x="270" y="0" width="80" height="30" uuid="835948f8-45ba-4c4a-8306-c6ad70214ba0"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <textFieldExpression><![CDATA[$F{date}]]></textFieldExpression> </textField> <componentElement> <reportElement x="350" y="0" width="100" height="30" uuid="89f3fd2c-4be0-466c-9b22-c749e8b69d42"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="NextPaymentDateDataset" uuid="964313c4-37e8-408f-adca-e6c436a76d4b"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("nextpayment")]]></dataSourceExpression> </datasetRun> <jr:listContents height="30" width="100"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="143efbb1-c95a-49bf-adff-a618b5518c75"/> <textFieldExpression><![CDATA[$F{item}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> <componentElement> <reportElement x="450" y="0" width="100" height="30" uuid="d569f091-7eac-44db-8e12-d83837b0ddae"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="NextPaymentValueDataset" uuid="7e2aa9c7-6d1f-4722-8f78-1f52da462473"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("valuenextpayment")]]></dataSourceExpression> </datasetRun> <jr:listContents height="30" width="100"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="a71eae3c-0bb7-4286-a80c-714a59d9f869"/> <textFieldExpression><![CDATA[$F{item}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>and produce the following output:

    With a JSON like the one I've reccommended:
    { "order":"000000", "valueorder":"270.00", "payment":"CRED CARD 2X", "date":"2017-03-17", "nextpayments": [ { "date": "17/03/2017", "value": "R$u00a0135,00" }, { "date": "02/05/2017", "value": "R$u00a0135,00" } ]}the JRXML will be more compact, with no lists and additional subDatasets:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="16882c94-641b-47b6-bd2f-675edbc1f15a"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <parameter name="jsonString" class="java.lang.String"> <defaultValueExpression><![CDATA["{n" + " "order":"000000",n" + " "valueorder":"270.00",n" + " "payment":"CRED CARD 2X",n" + " "date":"2017-03-17",n" + " "nextpayments": [n" + " {n" + " "date": "17/03/2017",n" + " "value": "R$\u00a0135,00" n" + " }, n" + " {n" + " "date": "02/05/2017",n" + " "value": "R$\u00a0135,00" n" + " }n" + " n" + " ]n" + "}"]]></defaultValueExpression> </parameter> <parameter name="JSON_INPUT_STREAM" class="java.io.InputStream"> <defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{jsonString}.getBytes("UTF-8"))]]></defaultValueExpression> </parameter> <queryString language="jsonql"> <![CDATA[nextpayments.*]]> </queryString> <field name="nextPaymentDate" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="date"/> <fieldDescription><![CDATA[next payment date]]></fieldDescription> </field> <field name="nextPaymentValue" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="value"/> <fieldDescription><![CDATA[next payment value]]></fieldDescription> </field> <field name="order" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.order"/> <fieldDescription><![CDATA[order]]></fieldDescription> </field> <field name="valueorder" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.valueorder"/> <fieldDescription><![CDATA[valueorder]]></fieldDescription> </field> <field name="payment" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.payment"/> <fieldDescription><![CDATA[payment]]></fieldDescription> </field> <field name="orderDate" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="^{2}.date"/> <fieldDescription><![CDATA[order date]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="180" y="20" width="200" height="30" uuid="33c1adf9-dc58-4d35-a409-72de3d4f0347"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14"/> </textElement> <text><![CDATA[Restructured JSON]]></text> </staticText> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="80" height="30" backcolor="#BEFADB" uuid="5258fbf3-575f-486e-bede-26e83ec791a5"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6b5c10f8-8390-4a95-a707-2f267d64349a"/> </reportElement> <text><![CDATA[order]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="80" y="0" width="90" height="30" backcolor="#BEFADB" uuid="464a7d52-1801-4d67-9cda-c4b2d2e4526b"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a223b8db-9803-4257-baf6-cfbc758b6950"/> </reportElement> <text><![CDATA[valueorder]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="170" y="0" width="100" height="30" backcolor="#BEFADB" uuid="c179e19a-efa9-4d27-947c-84b14d2639aa"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="166b5682-4aab-4c8a-b7d3-4e7b4be84db6"/> </reportElement> <text><![CDATA[payment]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="270" y="0" width="80" height="30" backcolor="#BEFADB" uuid="cb1829b9-c782-42a7-a3f4-0126db20cc6a"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[order date]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="350" y="0" width="100" height="30" backcolor="#BEFADB" uuid="628c20fa-bbc9-43ea-8aa4-1486bf518e38"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[next payment date]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="450" y="0" width="100" height="30" backcolor="#BEFADB" uuid="2b4c49a7-1984-48d4-aa92-9a6d859feda8"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[next payment value]]></text> </staticText> </band> </columnHeader> <detail> <band height="30" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="30" uuid="27c8ae6d-def5-4abd-b691-d350fd92c719"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6b5c10f8-8390-4a95-a707-2f267d64349a"/> </reportElement> <textFieldExpression><![CDATA[$F{order}]]></textFieldExpression> </textField> <textField> <reportElement x="80" y="0" width="90" height="30" uuid="94342e9b-d545-441c-9350-9179e4cc2530"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a223b8db-9803-4257-baf6-cfbc758b6950"/> </reportElement> <textFieldExpression><![CDATA[$F{valueorder}]]></textFieldExpression> </textField> <textField> <reportElement x="170" y="0" width="100" height="30" uuid="8e5286de-d8ac-43a5-bc70-936d3b59db7d"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="166b5682-4aab-4c8a-b7d3-4e7b4be84db6"/> </reportElement> <textFieldExpression><![CDATA[$F{payment}]]></textFieldExpression> </textField> <textField> <reportElement x="270" y="0" width="80" height="30" uuid="835948f8-45ba-4c4a-8306-c6ad70214ba0"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <textFieldExpression><![CDATA[$F{orderDate}]]></textFieldExpression> </textField> <textField> <reportElement x="350" y="0" width="100" height="30" uuid="7bd69460-736a-4f02-b7c6-7aea7f6ae3e4"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="cdbb795a-808b-4e99-8f21-6666b54aa457"/> </reportElement> <textFieldExpression><![CDATA[$F{nextPaymentDate}]]></textFieldExpression> </textField> <textField> <reportElement x="450" y="0" width="100" height="30" uuid="770eaeb3-2c1e-4741-afee-4dc5b6c13058"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="dfbc2e2f-40e6-4809-b2fe-aa7033dbd0ea"/> </reportElement> <textFieldExpression><![CDATA[$F{nextPaymentValue}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>and produce the following output:

    If you don't want repeating values, select all the textfields except the ones containing $F{nextPaymentDate} and $F{nextPaymentValue} and uncheck the "Print Repeated Values" in the Properties Tab
    Edit #2:
    With a JSON like:
    { "1786616": { "order": "1786616", "valueorder": "330.00", "payment": "CARTu00c3O DE CRu00c9DITO", "date": "2017-02-13" }, "1786681": { "order": "1786681", "valueorder": "330.00", "payment": "CARTu00c3O CRu00c9DITO 4C/ACRu00c9SCIMO)", "date": "2017-02-13", "nextpayments": [{ "date": "13/02/2017", "value": "R$u00a082,50" }, { "date": "28/03/2017", "value": "R$u00a082,50" }, { "date": "11/05/2017", "value": "R$u00a082,50" }, { "date": "22/06/2017", "value": "R$u00a082,50" } ] }}If you are only interested in orders that have the "nextpayments" key, you could modify the above sample's query from:
    <queryString language="jsonql"> <![CDATA[nextpayments.*]]></queryString>to:
    <queryString language="jsonql"> <![CDATA[.*.nextpayments.*]]></queryString>But if you also want the order that does not have the "nextpayments" key you need to resort to a list-based solution, something similar to the first sample. Here's a sample JRXML:
    <?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.6.0.final using JasperReports Library version 6.6.0 --><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="Report1" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="16882c94-641b-47b6-bd2f-675edbc1f15a"> <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/> <subDataset name="NextPaymentsDateDataset" uuid="5337e69f-16e4-447d-a9e7-fbe6d25a479f"> <field name="nextPaymentDate" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="date"/> </field> <field name="nextPaymentValue" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="value"/> </field> </subDataset> <parameter name="jsonString" class="java.lang.String"> <defaultValueExpression><![CDATA["{n" + " "1786616": {n" + " "order": "1786616",n" + " "valueorder": "330.00",n" + " "payment": "CART\u00c3O DE CR\u00c9DITO",n" + " "date": "2017-02-13"n" + " },n" + " "1786681": {n" + " "order": "1786681",n" + " "valueorder": "330.00",n" + " "payment": "CART\u00c3O CR\u00c9DITO 4C\/ACR\u00c9SCIMO)",n" + " "date": "2017-02-13",n" + " "nextpayments": [{n" + " "date": "13\/02\/2017",n" + " "value": "R$\u00a082,50"n" + " },n" + " {n" + " "date": "28\/03\/2017",n" + " "value": "R$\u00a082,50"n" + " },n" + " {n" + " "date": "11\/05\/2017",n" + " "value": "R$\u00a082,50"n" + " },n" + " {n" + " "date": "22\/06\/2017",n" + " "value": "R$\u00a082,50"n" + " }n" + " ]n" + " }n" + "}"]]></defaultValueExpression> </parameter> <parameter name="JSON_INPUT_STREAM" class="java.io.InputStream"> <defaultValueExpression><![CDATA[new java.io.ByteArrayInputStream($P{jsonString}.getBytes("UTF-8"))]]></defaultValueExpression> </parameter> <queryString language="jsonql"> <![CDATA[.*]]> </queryString> <field name="order" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="order"/> <fieldDescription><![CDATA[order]]></fieldDescription> </field> <field name="valueorder" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="valueorder"/> <fieldDescription><![CDATA[valueorder]]></fieldDescription> </field> <field name="payment" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="payment"/> <fieldDescription><![CDATA[payment]]></fieldDescription> </field> <field name="date" class="java.lang.String"> <property name="net.sf.jasperreports.jsonql.field.expression" value="date"/> <fieldDescription><![CDATA[date]]></fieldDescription> </field> <background> <band splitType="Stretch"/> </background> <title> <band height="79" splitType="Stretch"> <staticText> <reportElement x="180" y="20" width="200" height="30" uuid="33c1adf9-dc58-4d35-a409-72de3d4f0347"/> <textElement textAlignment="Center" verticalAlignment="Middle"> <font size="14"/> </textElement> <text><![CDATA[Variable JSON arrays]]></text> </staticText> </band> </title> <pageHeader> <band height="35" splitType="Stretch"/> </pageHeader> <columnHeader> <band height="30" splitType="Stretch"> <staticText> <reportElement mode="Opaque" x="0" y="0" width="80" height="30" backcolor="#BEFADB" uuid="5258fbf3-575f-486e-bede-26e83ec791a5"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6b5c10f8-8390-4a95-a707-2f267d64349a"/> </reportElement> <text><![CDATA[order]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="80" y="0" width="90" height="30" backcolor="#BEFADB" uuid="464a7d52-1801-4d67-9cda-c4b2d2e4526b"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a223b8db-9803-4257-baf6-cfbc758b6950"/> </reportElement> <text><![CDATA[valueorder]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="170" y="0" width="100" height="30" backcolor="#BEFADB" uuid="c179e19a-efa9-4d27-947c-84b14d2639aa"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="166b5682-4aab-4c8a-b7d3-4e7b4be84db6"/> </reportElement> <text><![CDATA[payment]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="270" y="0" width="80" height="30" backcolor="#BEFADB" uuid="cb1829b9-c782-42a7-a3f4-0126db20cc6a"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[order date]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="350" y="0" width="100" height="30" backcolor="#BEFADB" uuid="628c20fa-bbc9-43ea-8aa4-1486bf518e38"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[next payment date]]></text> </staticText> <staticText> <reportElement mode="Opaque" x="450" y="0" width="100" height="30" backcolor="#BEFADB" uuid="2b4c49a7-1984-48d4-aa92-9a6d859feda8"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <text><![CDATA[next payment value]]></text> </staticText> </band> </columnHeader> <detail> <band height="35" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="80" height="30" uuid="27c8ae6d-def5-4abd-b691-d350fd92c719"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="6b5c10f8-8390-4a95-a707-2f267d64349a"/> </reportElement> <textFieldExpression><![CDATA[$F{order}]]></textFieldExpression> </textField> <textField> <reportElement x="80" y="0" width="90" height="30" uuid="94342e9b-d545-441c-9350-9179e4cc2530"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="a223b8db-9803-4257-baf6-cfbc758b6950"/> </reportElement> <textFieldExpression><![CDATA[$F{valueorder}]]></textFieldExpression> </textField> <textField> <reportElement x="170" y="0" width="100" height="30" uuid="8e5286de-d8ac-43a5-bc70-936d3b59db7d"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="166b5682-4aab-4c8a-b7d3-4e7b4be84db6"/> </reportElement> <textFieldExpression><![CDATA[$F{payment}]]></textFieldExpression> </textField> <textField> <reportElement x="270" y="0" width="80" height="30" uuid="835948f8-45ba-4c4a-8306-c6ad70214ba0"> <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="b7a27377-1e06-43c4-afab-840efea597f3"/> </reportElement> <textFieldExpression><![CDATA[$F{date}]]></textFieldExpression> </textField> <componentElement> <reportElement x="350" y="0" width="200" height="30" uuid="89f3fd2c-4be0-466c-9b22-c749e8b69d42"/> <jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical"> <datasetRun subDataset="NextPaymentsDateDataset" uuid="40421d98-9a67-451f-afe3-d835f0deaeaf"> <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("nextpayments")]]></dataSourceExpression> </datasetRun> <jr:listContents height="30" width="200"> <textField> <reportElement x="0" y="0" width="100" height="30" uuid="143efbb1-c95a-49bf-adff-a618b5518c75"/> <textFieldExpression><![CDATA[$F{nextPaymentDate}]]></textFieldExpression> </textField> <textField> <reportElement x="100" y="0" width="100" height="30" uuid="16ce45fb-1631-4e0b-9875-9427f6544c7e"/> <textFieldExpression><![CDATA[$F{nextPaymentValue}]]></textFieldExpression> </textField> </jr:listContents> </jr:list> </componentElement> </band> </detail> <columnFooter> <band height="45" splitType="Stretch"/> </columnFooter> <pageFooter> <band height="54" splitType="Stretch"/> </pageFooter> <summary> <band height="42" splitType="Stretch"/> </summary></jasperReport>with this output:

  17. narcism's post in Report with subreport in subreport by JSON was marked as the answer   
    You get that message because your PROJECT.jrxml does not compile. The one that you linked contains an invalid subreport expression:
    <subreportExpression><![CDATA[in properties>subreport>Expression "USER.jrxml"]]></subreportExpression>[/code]The expression should be just "USER.jrxml". Make sure you recompile each modified subreport or choose Project > Build Automatically to have Studio do it for you after saving each modified file.
    Once you get past the above issue:
    1. Remove the connectionExpression that passes $P{REPORT_CONNECTION}. It has effect only for JDBC connections, which you don't have.
    2. In CUSTOMER.jrxml set this dataSourceExpression:
    <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("projectReportDtos")]]></dataSourceExpression>[/code]3. In PROJECT.jrxml set this dataSourceExpression:
    <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("userReportDtos")]]></dataSourceExpression>[/code]4. Optionally, you may want to delete the unused bands and/or shrink the detail bands in order to reduce the white space between records.
  18. narcism's post in Need to set json data having list of list to show in table based on rowspan using jasper soft was marked as the answer   
    In a very basic way you can achieve what you want like so:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- Created with Jaspersoft Studio version 6.5.1.final using JasperReports Library version 6.5.1  -->
    <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="JSONQL_no_table" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="98c9b141-c0bd-4f9f-a8d6-b9b3caaf615d">
        <queryString language="jsonql">
            <![CDATA[data.programmes.*]]>
        </queryString>
        <field name="JobRole" class="java.lang.String">
            <property name="net.sf.jasperreports.jsonql.field.expression" value="^^jobRole"/>
        </field>
        <field name="Programe" class="java.lang.String">
            <property name="net.sf.jasperreports.jsonql.field.expression" value="programe"/>
        </field>
        <field name="Provider" class="java.lang.String">
            <property name="net.sf.jasperreports.jsonql.field.expression" value="provider"/>
        </field>
        <background>
            <band splitType="Stretch"/>
        </background>
        <title>
            <band height="79" splitType="Stretch"/>
        </title>
        <pageHeader>
            <band height="35" splitType="Stretch"/>
        </pageHeader>
        <columnHeader>
            <band height="30" splitType="Stretch">
                <staticText>
                    <reportElement mode="Opaque" x="0" y="0" width="185" height="30" backcolor="#D2FAF6" uuid="d82ddd57-6ddd-470f-b75a-3c7e02701dc7">
                        <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="90cf53a0-a0d3-4bfe-bf2b-bd79c533db73"/>
                    </reportElement>
                    <text><![CDATA[JobRole]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="185" y="0" width="185" height="30" backcolor="#D2FAF6" uuid="a7760d02-ea94-446c-a42a-49da6f2446e5">
                        <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="444f9be5-2968-463d-b008-68d4fb3d5317"/>
                    </reportElement>
                    <text><![CDATA[Programe]]></text>
                </staticText>
                <staticText>
                    <reportElement mode="Opaque" x="370" y="0" width="185" height="30" backcolor="#D2FAF6" uuid="0064f2ea-7529-4772-a3e7-83258c146ae9">
                        <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="c06960f0-e4bf-481e-9050-bdacd95bf764"/>
                    </reportElement>
                    <text><![CDATA[Provider]]></text>
                </staticText>
            </band>
        </columnHeader>
        <detail>
            <band height="30" splitType="Stretch">
                <textField>
                    <reportElement x="185" y="0" width="185" height="30" uuid="f9705c9f-75c8-476e-aae6-66655b790479">
                        <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="444f9be5-2968-463d-b008-68d4fb3d5317"/>
                    </reportElement>
                    <textFieldExpression><![CDATA[$F{Programe}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="370" y="0" width="185" height="30" uuid="37ca4922-b0fc-4588-8905-997e4fae4471">
                        <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="c06960f0-e4bf-481e-9050-bdacd95bf764"/>
                    </reportElement>
                    <textFieldExpression><![CDATA[$F{Provider}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement isPrintRepeatedValues="false" x="0" y="0" width="185" height="30" uuid="b2e61cda-d53c-4d7a-a123-3233548528a1">
                        <property name="com.jaspersoft.studio.spreadsheet.connectionID" value="90cf53a0-a0d3-4bfe-bf2b-bd79c533db73"/>
                    </reportElement>
                    <textFieldExpression><![CDATA[$F{JobRole}]]></textFieldExpression>
                </textField>
            </band>
        </detail>
        <columnFooter>
            <band height="54" splitType="Stretch"/>
        </columnFooter>
        <pageFooter>
            <band height="54" splitType="Stretch"/>
        </pageFooter>
        <summary>
            <band height="42" splitType="Stretch"/>
        </summary>
    </jasperReport>
     
  19. narcism's post in JSON array as table was marked as the answer   
    You only need to subDatasource inside your table's datasetRun. I'm posting only the relevant changes:
    1. The subDataset definition:
    <subDataset name="proofs" whenResourceMissingType="Key" uuid="4563e834-a9e5-43b5-9f0a-824948c73c73">
        <field name="proofType" class="java.lang.String">
            <property name="net.sf.jasperreports.jsonql.field.expression" value="proofType"/>
        </field>
        <field name="proofName" class="java.lang.String">
            <property name="net.sf.jasperreports.jsonql.field.expression" value="proofName"/>
        </field>
        <field name="proofFile" class="java.lang.String">
            <property name="net.sf.jasperreports.jsonql.field.expression" value="proofFile"/>
        </field>
    </subDataset>
    2. The table datasetRun definition:
    <datasetRun subDataset="proofs" uuid="75af8bcf-1dd6-4a94-9e96-0d976350d14e">
        <dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("proofs.*")]]></dataSourceExpression>
    </datasetRun>
     
  20. narcism's post in How to render the results of the visualize.js api resourcesSearch to a <li> elements inside a menu was marked as the answer   
    You need to:
    1. Delay the jqxMenu creation until all the submenu items are in the DOM
    2. Store the item.uri in a different location
    Something like so:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
        <meta http-equiv="content-type" content="text/html; charset=windows-1250">
        <meta name="generator" content="PSPad editor, www.pspad.com">
        <title>Reporting Menu - Vertical Menu Sample</title>
        <script type='text/javascript' src="../resources/scripts/jquery-3.3.1.js"></script>
        <link rel="stylesheet" href="../resources/jqwidgets/styles/jqx.base.css" type="text/css"/>
        <script type="text/javascript" src="../resources/jqwidgets/jqxcore.js"></script>
        <script type="text/javascript" src="../resources/jqwidgets/jqxmenu.js"></script>
        <script type='text/javascript' src="http://auditpreprod:8082/jasperserver-pro/client/visualize.js?logEnabled..."></script>
    </head>
    <body>
        <div id='content'>
            <div id='jqxWidget' style="display: none;">
                <div id='jqxMenu' class="jqxMenu">
                    <ul>
                    <li id ='mainmenuid'>Reporting </li>
                    <li id ='requestmenuid'>Request Managments
                        <ul id ='ulrequestmenuid'></ul>
                    </li>
                    </ul>
                </div>
            </div>
        </div>
        <div id="placeholder"></div>
        <script>
            visualize({
                auth: {
                    name: "superuser",
                    password: "superuser"
                }
            }, function (v) {
                v.resourcesSearch({
                    folderUri: "/public",
                    recursive: true,
                    types: ["reportUnit","dashboard"],
                    success: renderResults,
                    error: handleError
                });
                // utility function
                function renderResults(results) {
                    var $submenu = $("#ulrequestmenuid");
                    $submenu.html("");
                    $.each(results, function (i, item) {
                        $submenu.append('<li><span data-uri="' + item.uri + '">'+ item.label+'</span></li>');
                    });
                    $("#jqxMenu").jqxMenu({ width: '300', mode: 'vertical'});
                    $("#jqxWidget").show();
                }
                $("#ulrequestmenuid").on("click", "span", function(evt) {
                    var resourceUri = $(this).data("uri");
                    v("#placeholder").report({
                        resource: resourceUri,
                        error:handleError
                    });
                });
            
                function handleError(err){
                    alert(err.message);
                };
            });  
        </script>
    </body>
    </html>
  21. narcism's post in JSONQL: Is there a way to replace the literal reference with the current value of the column I'm iterating over? was marked as the answer   
    Your initial query, $.dafs.id(@val == "3434343")[0].name, does not yield any results because you are trying to advance the 'name' key into an 'id' value:
    $.dafs.id(@val == "3434343")[0] produces "3434343" and "3434343".name does not make any sense.
     
    As @SuperDave pointed out, you need to go one level up(to the object holding the id property that you filtered) and get the 'name' property:
    $.dafs.id(@val == "3434343")[0]^{1}.name
     
    If your IDs are unique you don't need to select the first one with [0] and if you are going up one level you could just use ^ instead of ^{1} and have a simpler query like so:
    $.dafs.id(@val == "3434343")^.name
     
    If your query is the mainDataset's query, you can skip the $ sign as it has no influence there, but only when used on field expression properties. 
    Your mainDataset's query could eventually looks like so: dafs.id(@val == "3434343")^.name
     
    Other queries that might produce the same result could be:
    dafs.*(id == "3434343").name, meaning: get all the 'dafs' children(.*) with an id of "3434343", then get the name
    ..name(^.id == "3434343"), meaning: get the name from everywhere(..name), whose parent has an id of "3434343"
    ..*(id == "3434343").name, meaning: get everything with an id of "3434343" then select its name
     
    Now, for a sample JSON file like this one:
    {
        "dafs": [{
                "id": "3434343",
                "name": "TEST"
            }, {
                "id": "7777777",
                "name": "TEST2"
            }
        ],
        "details": [{
                "dafId": "3434343",
                "value": "foo"
            }, {
                "dafId": "3434343",
                "value": "bar"
            }, {
                "dafId": "7777777",
                "value": "foo2"
            }
        ]
    }
    you could achieve what you want like so:
  22. narcism's post in JSONQL filter a list of images was marked as the answer   
    You cannot operate on the keys of the "_attachments" object. Had it been an array, you could have. Future versions of JasperReports may address this issue.
    In this case:
    you could filter by a fixed key like "digest". You could do that with an expression like: _attachments.*(digest != "md5-VJaOsR0z8+RUMYCSSSvf2A==")[/code] 
    or, if you know that the key you are trying to leave out is always the first one in the list, you could skip it with this expression:_attachments.*[1:][/code] 
  23. narcism's post in How delete backcolor property from JasperStudio interface? was marked as the answer   
    I have recently discovered that right-clicking on the actual color box pops up a "Set to Null" menu that helps achieving what you are after. In fact right-clicking on other properties pops up menus with "Reset to Default" option in addition to the one above. Tested in JasperSoft Studio 6.4.0.
  24. narcism's post in SubReport not working..... was marked as the answer   
    A couple of things to check, each at a time:
    1. Make sure you recompile your subreport every time you modify it. You may have an old *.jasper file for it and that one gets picked up by your mainReport.
    2. Place some limits on the mainReport's query and check the data from the subreport. You could even place some textfields with your parameters at the top of the subreport, in a title band for instance, to see if they get passed correctly.
    3. Perform some record counting to understand how big the resultsets are, especially for the subReport's query.
  25. narcism's post in jsonql query question was marked as the answer   
    Hi, Ernesto!
    The main dataset query could be left empty in this case. I believe that what you have as field expression/description is not exactly what JSONQL expects. This should work:
    In essence, to pick the users.name(or similar) key you need the ["users.name"] JSONQL expression. This happens because the users.name key is not a legal Javascript identifier an must be wrapped in quotes and surrounded by square brackets. It is similar to the Javascript way of accessing object keys.
    More specific details could be found here: http://jasperreports.sourceforge.net/sample.reference/jsonqldatasource/index.html#jsonql
×
×
  • Create New...