Jump to content
Changes to the Jaspersoft community edition download ×

Nested table data source woes: JSON_INPUT_STREAM and REPORT_DATA_SOURCE seem broken


srhaque

Recommended Posts

I'm trying to get nested tables working with my JSON data. My outer table works just fine, and has its data source set in the usual way like this:

$P{REPORT_DATA_SOURCE}.subDataSource("employee.*")[/code]

In the Detail band of this outer table, I'm trying to set up a nested table, but using the corresponding data source:

$P{REPORT_DATA_SOURCE}.subDataSource("buss.*")[/code]

always just gives me no records. In trying to debug this, if I set the string parameter to "employee_id" which is a field in the outer table, I do get a single result record. This seems to suggest that the inner table is getting a data source not based in the root of the JSON heirarchy, but rather at the level of the outer table. I therefore tried all sorts of alternatives to the string parameter to try to move up to the root, including "^^.buss.*" and "$.buss.*" to no avail.

Interestingly, if I try to set the data source using like this:

net.sf.jasperreports.engine.data.JsonQLDataSource($P{JSON_INPUT_STREAM})[/code]

then I get an error to the effect that the $P{JSON_INPUT_STREAM} is null:

...Caused by: org.mozilla.javascript.EvaluatorException: The choice of Java constructor net.sf.jasperreports.engine.data.JsonQLDataSource matching JavaScript argument types (null) is ambiguous; candidate constructors are:    JsonQLDataSource(java.io.File)    JsonQLDataSource(java.io.InputStream) (multipayslip_Employees_1544352224903_109951#8)...[/code]

The overall effect seems to be that the various system defined parameters $P{REPORT_DATA_SOURCE} and $P{JSON_INPUT_STREAM} are not being passed into the nested table as I am expecting. What am I missing?

I've scoured this forum and StackOverflow to no effect, so any hints are welcome.

Thanks, Shaheed

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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="multipayslip" language="javascript" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="975714cc-487b-4780-af93-96ba4c6852ec">  <property name="com.jaspersoft.studio.data.defaultdataadapter" value="JSON QL data"/>  <style name="Table_TH" mode="Opaque" forecolor="#FFFFFF" backcolor="#08243C" fontSize="14">    <box padding="4">      <pen lineWidth="0.0" lineColor="#000000"/>    </box>  </style>  <style name="Table_CH" mode="Opaque" forecolor="#FFFFFF" backcolor="#3A799A" fontSize="12">    <box padding="4">      <pen lineWidth="0.5" lineColor="#FFFFFF"/>    </box>  </style>  <style name="Table_TD" mode="Opaque" forecolor="#000000" backcolor="#A8ABA5" fontSize="12">    <box padding="4">      <pen lineWidth="0.5" lineColor="#FFFFFF"/>    </box>  </style>  <subDataset name="Busses" uuid="2817bd63-7c51-483d-bb88-e6b37adc973b">    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="JSON QL data"/>    <parameter name="employee_key" class="java.lang.String"/>    <queryString language="jsonql">      <![CDATA[buss.*]]>    </queryString>    <field name="name" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="name"/>      <fieldDescription><![CDATA[name]]></fieldDescription>    </field>    <field name="description" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="description"/>      <fieldDescription><![CDATA[description]]></fieldDescription>    </field>  </subDataset>  <subDataset name="Employees" uuid="ba80e38d-858c-49c5-a296-c779f28992f2">    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="JSON QL data"/>    <parameter name="employee_id" class="java.lang.String">      <parameterDescription><![CDATA[Employee database id to generate report for; empty means all employees]]></parameterDescription>    </parameter>    <queryString language="jsonql">      <![CDATA[employee.*]]>    </queryString>    <field name="id" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="id"/>    </field>    <field name="name" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="name"/>    </field>    <field name="email" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="email"/>    </field>    <field name="title" class="java.lang.Integer">      <property name="net.sf.jasperreports.jsonql.field.expression" value="title"/>    </field>    <field name="start_date" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="start_date"/>    </field>    <field name="end_date" class="java.lang.String">      <property name="net.sf.jasperreports.jsonql.field.expression" value="end_date"/>    </field>    <field name="test_employee" class="java.lang.Boolean">      <property name="net.sf.jasperreports.jsonql.field.expression" value="test_employee"/>    </field>    <field name="pay_graph_results" class="java.lang.Object">      <property name="net.sf.jasperreports.json.field.expression" value="pay_graph_results"/>    </field>    <field name="ee_tax_basis" class="java.lang.String">      <property name="net.sf.jasperreports.json.field.expression" value="ee_tax_basis"/>    </field>    <field name="ee_tax_reference" class="java.lang.String">      <property name="net.sf.jasperreports.json.field.expression" value="ee_tax_reference"/>    </field>    <field name="ee_bank_account" class="java.lang.String">      <property name="net.sf.jasperreports.json.field.expression" value="ee_bank_account"/>    </field>    <field name="top" class="java.lang.Object">      <propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$"]]></propertyExpression>      <fieldDescription><![CDATA[Top level object]]></fieldDescription>    </field>    <filterExpression><![CDATA[/* The filter is not set, or your id matches the filter. */                                   ([null, "", $F{id}].indexOf($P{employee_id}) > -1) &&                                   /* You started before the end of the pay period. */                                   ($F{start_date} <= $F{top}.get("pay_run").get("pay_period_last_day").asText()) &&                                   /* You have not planned to leave, or are leaving after the start of the pay period. */                                   (($F{end_date} === null) || ($F{end_date} >= $F{top}.get("pay_run").get("pay_period_first_day").asText())) &&                                   /* You are not a test employee. */                                   !$F{test_employee}]]></filterExpression>  </subDataset>  <parameter name="employee_id" class="java.lang.String" isForPrompting="false">    <parameterDescription><![CDATA[Employee database id to generate report for; empty means all employees]]></parameterDescription>  </parameter>  <queryString language="jsonql">    <![CDATA[]]>  </queryString>  <field name="top" class="java.lang.Object">    <propertyExpression name="net.sf.jasperreports.jsonql.field.expression"><![CDATA["$"]]></propertyExpression>    <fieldDescription><![CDATA[Top level object]]></fieldDescription>  </field>  <background>    <band splitType="Stretch"/>  </background>  <title>    <band height="79" splitType="Stretch">      <textField>        <reportElement style="Table_TH" x="0" y="9" width="510" height="25" uuid="8c7b9edf-1377-4d38-b221-47a9f52c34a3"/>        <textFieldExpression><![CDATA[$F{top}.get("company").get("legal_name").asText() + ", " + $F{top}.get("pay_run").get("actual_t").asText()]]></textFieldExpression>      </textField>    </band>  </title>  <detail>    <band height="420" splitType="Stretch">      <componentElement>        <reportElement x="0" y="20" width="520" height="400" uuid="5e3b943e-010c-4754-835d-d01807e66701">          <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>          <property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>          <property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>          <property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>        </reportElement>        <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="Employees" uuid="c0ea6019-8850-42da-abf4-3773fce40409">            <dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}.subDataSource("employee.*")]]></dataSourceExpression>          </datasetRun>          <jr:column width="510" uuid="e4eda8c4-742e-4f0e-8771-072d081e8e2e">            <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>            <jr:tableHeader style="Table_TH" height="40" rowSpan="1">              <textField>                <reportElement style="Table_TH" x="0" y="0" width="502" height="32" uuid="d5e0888d-0a79-4da0-8ec6-252d674b81b9"/>                <textFieldExpression><![CDATA[(function () {                var a = new Object($F{top}.get("buss"));                 var b = [];                for (var p in a) {                    b.push(a[p]);                }                return new net.sf.jasperreports.engine.data.JRMapArrayDataSource(b);                }).apply()]]></textFieldExpression>              </textField>            </jr:tableHeader>            <jr:columnHeader height="186" rowSpan="1">              <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.grid.JSSGridBagLayout"/>              <box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0"/>              <textField>                <reportElement style="Table_TH" x="0" y="0" width="510" height="30" uuid="3bcfb36e-a0f3-4dea-b65c-ac27c0cd2078">                  <property name="com.jaspersoft.layout.grid.x" value="0"/>                  <property name="com.jaspersoft.layout.grid.y" value="0"/>                  <property name="com.jaspersoft.layout.grid.weight.x" value="1.0"/>                  <property name="com.jaspersoft.layout.grid.weight.y" value="1.0"/>                  <property name="com.jaspersoft.layout.grid.rowspan" value="1"/>                  <property name="com.jaspersoft.layout.grid.colspan" value="2"/>                  <property name="com.jaspersoft.layout.grid.weight.fixed" value="true"/>                </reportElement>                <textFieldExpression><![CDATA[$F{top}.get("title").get("" + $F{title}).get("title").asText() + " " + $F{name} + " (" + $F{email} + ")"]]></textFieldExpression>              </textField>              <frame>                <reportElement x="0" y="30" width="300" height="156" uuid="e3863d13-f57c-4e26-be43-c356442e665c">                  <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>                  <property name="com.jaspersoft.layout.grid.x" value="0"/>                  <property name="com.jaspersoft.layout.grid.y" value="1"/>                  <property name="com.jaspersoft.layout.grid.weight.x" value="1.0"/>                  <property name="com.jaspersoft.layout.grid.weight.y" value="1.0"/>                  <property name="com.jaspersoft.layout.grid.rowspan" value="6"/>                  <property name="com.jaspersoft.layout.grid.colspan" value="1"/>                  <property name="com.jaspersoft.layout.grid.weight.fixed" value="true"/>                </reportElement>                <staticText>                  <reportElement style="Table_CH" x="0" y="0" width="300" height="26" uuid="44d8982c-5fbd-4a56-a1db-21eb2c4294da"/>                  <text><![CDATA[Gross pay]]></text>                </staticText>                <staticText>                  <reportElement style="Table_CH" x="0" y="26" width="300" height="26" uuid="de135741-9a2b-4a18-9b87-b0a81f01ebe4"/>                  <text><![CDATA[Deductions]]></text>                </staticText>                <staticText>                  <reportElement style="Table_CH" x="0" y="52" width="300" height="26" uuid="2f488537-3ca8-4483-ba19-5b88b06d03cd"/>                  <text><![CDATA[Net pay]]></text>                </staticText>                <staticText>                  <reportElement style="Table_CH" x="0" y="78" width="300" height="26" uuid="e4a4df17-71fd-431b-9459-785a9b2e9777"/>                  <text><![CDATA[Tax reference]]></text>                </staticText>                <staticText>                  <reportElement style="Table_CH" x="0" y="104" width="300" height="26" uuid="bf27d631-7ff1-40aa-9ae9-350ea1823ed5"/>                  <text><![CDATA[Tax basis]]></text>                </staticText>                <staticText>                  <reportElement style="Table_CH" x="0" y="130" width="300" height="26" uuid="de7f5bd1-df08-4b28-a13c-1ba604133ff1"/>                  <text><![CDATA[bank Account]]></text>                </staticText>              </frame>              <frame>                <reportElement x="300" y="30" width="210" height="156" uuid="1628fbd8-cc7b-4213-b45e-c9bef24dce5e">                  <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>                  <property name="com.jaspersoft.layout.grid.x" value="1"/>                  <property name="com.jaspersoft.layout.grid.y" value="1"/>                  <property name="com.jaspersoft.layout.grid.weight.x" value="1.0"/>                  <property name="com.jaspersoft.layout.grid.weight.y" value="1.0"/>                  <property name="com.jaspersoft.layout.grid.rowspan" value="6"/>                  <property name="com.jaspersoft.layout.grid.colspan" value="1"/>                  <property name="com.jaspersoft.layout.grid.weight.fixed" value="true"/>                </reportElement>                <textField>                  <reportElement style="Table_TD" x="0" y="0" width="210" height="26" uuid="e0dda6f4-d5b9-4934-9f59-6250999ce20e"/>                  <textFieldExpression><![CDATA[parseFloat($F{pay_graph_results}.get("gross_pay")).toFixed(2)]]></textFieldExpression>                </textField>                <textField>                  <reportElement style="Table_TD" x="0" y="26" width="210" height="26" uuid="3247e522-006c-400f-8ff4-98a9b6ed75ea"/>                  <textFieldExpression><![CDATA[($F{pay_graph_results}.get("gross_pay") - $F{pay_graph_results}.get("net_pay")).toFixed(2)]]></textFieldExpression>                </textField>                <textField>                  <reportElement style="Table_TD" x="0" y="52" width="210" height="26" uuid="51e5b667-68ee-47fd-8c4a-260ec22107df"/>                  <textFieldExpression><![CDATA[parseFloat($F{pay_graph_results}.get("net_pay")).toFixed(2)]]></textFieldExpression>                </textField>                <textField>                  <reportElement style="Table_TD" x="0" y="78" width="210" height="26" uuid="04f7103e-c02c-42c0-bcd1-3ab95a14b800"/>                  <textFieldExpression><![CDATA[$F{ee_tax_basis}]]></textFieldExpression>                </textField>                <textField>                  <reportElement style="Table_TD" x="0" y="104" width="210" height="26" uuid="569a62af-4210-479a-8f9c-1b8f94806226"/>                  <textFieldExpression><![CDATA[(function () {var a=""+$F{ee_tax_reference}; return a.substr(0, a.length-3).replace(/w/gi, "*") + a.substr(a.length - 3);}).apply()]]></textFieldExpression>                </textField>                <textField>                  <reportElement style="Table_TD" x="0" y="130" width="210" height="26" uuid="66a4611f-219a-4c07-9521-7eaa1e9e7e3e"/>                  <textFieldExpression><![CDATA[(function () {var a=""+$F{ee_bank_account}; return a.substr(0, a.length-3).replace(/w/gi, "*") + a.substr(a.length - 3);}).apply()]]></textFieldExpression>                </textField>              </frame>            </jr:columnHeader>            <jr:detailCell height="137">              <box topPadding="20"/>              <componentElement>                <reportElement x="0" y="0" width="510" height="117" uuid="d38e0fea-3e6d-4eed-bf6d-b13997fb05a1">                  <property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>                  <property name="com.jaspersoft.studio.table.style.table_header" value="Table_TH"/>                  <property name="com.jaspersoft.studio.table.style.column_header" value="Table_CH"/>                  <property name="com.jaspersoft.studio.table.style.detail" value="Table_TD"/>                </reportElement>                <jr:table>                  <datasetRun subDataset="Busses" uuid="54507be6-3136-4590-9ec4-a33ce73911e5">                    <datasetParameter name="employee_key">                      <datasetParameterExpression><![CDATA[$F{id}]]></datasetParameterExpression>                    </datasetParameter>                    <dataSourceExpression><![CDATA[$P{REPORT_DATA_SOURCE}.subDataSource("employee_id")]]></dataSourceExpression>                  </datasetRun>                  <jr:column width="100" uuid="299a669e-1c4d-4767-85ec-fd7b1cd2f75e">                    <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column1"/>                    <jr:columnHeader height="40" rowSpan="1">                      <staticText>                        <reportElement style="Table_CH" x="0" y="0" width="100" height="40" uuid="fbcbda95-9897-455e-88eb-6419f0d356de"/>                        <text><![CDATA[name]]></text>                      </staticText>                    </jr:columnHeader>                    <jr:detailCell height="40">                      <textField>                        <reportElement style="Table_TD" x="0" y="0" width="100" height="40" uuid="2d9a305c-1da2-4cae-8b7d-0e23e905464f"/>                        <textFieldExpression><![CDATA[$F{name}]]></textFieldExpression>                      </textField>                    </jr:detailCell>                  </jr:column>                  <jr:column width="200" uuid="de42aaac-a2fe-4481-a710-89bc00c8f419">                    <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column2"/>                    <jr:columnHeader height="40" rowSpan="1">                      <staticText>                        <reportElement style="Table_CH" x="0" y="0" width="200" height="40" uuid="8d3966a4-4032-440e-b608-209247fe7aa0"/>                        <text><![CDATA[description]]></text>                      </staticText>                    </jr:columnHeader>                    <jr:detailCell height="40">                      <textField>                        <reportElement style="Table_TD" x="0" y="0" width="200" height="40" uuid="e0228ace-c766-4ace-8feb-664e04b67924"/>                        <textFieldExpression><![CDATA[$F{description}]]></textFieldExpression>                      </textField>                    </jr:detailCell>                  </jr:column>                  <jr:column width="110" uuid="bc371f28-90bc-452e-9ce7-7ae30e4f905b">                    <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column3"/>                    <jr:columnHeader height="40" rowSpan="1">                      <staticText>                        <reportElement style="Table_CH" x="0" y="0" width="110" height="40" uuid="8c203d8b-25e7-4e73-9890-6bfe941c099c"/>                        <text><![CDATA[periodValue]]></text>                      </staticText>                    </jr:columnHeader>                    <jr:detailCell height="40">                      <textField>                        <reportElement style="Table_TD" x="0" y="0" width="110" height="40" uuid="6605a07f-e2c1-4264-9d75-5b92cda707e1"/>                        <textFieldExpression><![CDATA["z"]]></textFieldExpression>                      </textField>                    </jr:detailCell>                  </jr:column>                  <jr:column width="100" uuid="a02cfe69-4b53-4ebb-94a7-70cf5e1166f9">                    <property name="com.jaspersoft.studio.components.table.model.column.name" value="Column4"/>                    <jr:columnHeader height="40" rowSpan="1">                      <staticText>                        <reportElement style="Table_CH" x="0" y="0" width="100" height="40" uuid="72715923-8cc3-46ca-8a53-f02d3f22600f"/>                        <text><![CDATA[yearToDateValue]]></text>                      </staticText>                    </jr:columnHeader>                    <jr:detailCell height="40">                      <textField>                        <reportElement style="Table_TD" x="0" y="0" width="100" height="40" uuid="d9c971ce-1ad1-4935-9873-2d969b4e1c8b"/>                        <textFieldExpression><![CDATA["s"]]></textFieldExpression>                      </textField>                    </jr:detailCell>                  </jr:column>                </jr:table>              </componentElement>            </jr:detailCell>          </jr:column>        </jr:table>      </componentElement>    </band>  </detail></jasperReport>[/code]

and sample JSON:

{  "buss": {    "10001": {      "id": 10001,      "name": "company0",      "description": "Custom use 0",      "jurisdiction": "Company"    },    "10002": {      "id": 10002,      "name": "company1",      "description": "Custom use 1",      "jurisdiction": "Company"    },    "10003": {      "id": 10003,      "name": "company2",      "description": "Custom use 2",      "jurisdiction": "Company"    },    "10004": {      "id": 10004,      "name": "company3",      "description": "Custom use 3",      "jurisdiction": "Company"    },    "10005": {      "id": 10005,      "name": "company4",      "description": "Custom use 4",      "jurisdiction": "Company"    },    "10006": {      "id": 10006,      "name": "company5",      "description": "Custom use 5",      "jurisdiction": "Company"    },    "10007": {      "id": 10007,      "name": "company6",      "description": "Custom use 6",      "jurisdiction": "Company"    },    "10008": {      "id": 10008,      "name": "company7",      "description": "Custom use 7",      "jurisdiction": "Company"    },    "10009": {      "id": 10009,      "name": "company8",      "description": "Custom use 8",      "jurisdiction": "Company"    },    "10010": {      "id": 10010,      "name": "company9",      "description": "Custom use 9",      "jurisdiction": "Company"    },    "10011": {      "id": 10011,      "name": "bonus_eligible_pay",      "description": "Bonus-eligible pay",      "jurisdiction": "Universal"    },    "10012": {      "id": 10012,      "name": "holidays_accrued",      "description": "Holidays accrued",      "jurisdiction": "Universal"    },    "10013": {      "id": 10013,      "name": "holidays_taken",      "description": "Holidays taken",      "jurisdiction": "Universal"    },    "10014": {      "id": 10014,      "name": "net_pay",      "description": ".Net pay",      "jurisdiction": "Universal"    },    "10015": {      "id": 10015,      "name": "PE",      "description": "Pension-eligible pay",      "jurisdiction": "Universal"    },    "10016": {      "id": 10016,      "name": "pension",      "description": "Pension saving",      "jurisdiction": "Universal"    },    "10017": {      "id": 10017,      "name": "gross_pay",      "description": ".Gross pay",      "jurisdiction": "Universal"    },    "10018": {      "id": 10018,      "name": "sick_days_taken",      "description": "Sick days taken",      "jurisdiction": "Universal"    },    "10019": {      "id": 10019,      "name": "PBIK",      "description": "Payroll benefits in kind",      "jurisdiction": "Universal"    },    "20001": {      "id": 20001,      "name": "paye_gp",      "description": "Gross pay for PAYE purposes",      "jurisdiction": "GB"    },    "20002": {      "id": 20002,      "name": "nic_gp",      "description": "Gross pay for NIC purposes",      "jurisdiction": "GB"    },    "20003": {      "id": 20003,      "name": "QE",      "description": "Qualifying earnings",      "jurisdiction": "GB"    },    "20004": {      "id": 20004,      "name": "income_tax",      "description": "PAYE.Tax paid",      "jurisdiction": "GB"    },    "20005": {      "id": 20005,      "name": "nic_ee",      "description": "NIC.Employee",      "jurisdiction": "GB"    },    "20006": {      "id": 20006,      "name": "nic_er",      "description": "NIC.Employer",      "jurisdiction": "GB"    },    "20007": {      "id": 20007,      "name": "sl_recovered",      "description": "Student Loan recovered",      "jurisdiction": "GB"    },    "20008": {      "id": 20008,      "name": "ae_pension",      "description": "AE Pension",      "jurisdiction": "GB"    }  },  "title": {    "1": {      "id": 1,      "title": "Mr.",      "is_suffix": false    },    "2": {      "id": 2,      "title": "Ms.",      "is_suffix": false    },    "3": {      "id": 3,      "title": "Mrs.",      "is_suffix": false    },    "4": {      "id": 4,      "title": "Miss.",      "is_suffix": false    }  },  "client": {    "id": 62,    "legal_name": "HMRC"  },  "company": {    "id": 112,    "client": 62,    "legal_name": "HMRC RTI Recognition",    "jurisdiction": "GB"  },  "pay_run": {    "id": 1562,    "manual": true,    "next_t": "2019-04-30",    "company": 112,    "actual_t": "2019-03-31",    "schedule": 73,    "target_t": "2019-03-31",    "tax_week": 52,    "tax_year": 2018,    "frequency": "m1",    "tax_month": 12,    "scale_factor": 0.08333333333333333,    "pay_period_last_day": "2019-04-05",    "pay_period_first_day": "2019-03-06"  },  "success": true,  "employee": {    "293": {      "id": 293,      "name": "Jimmy Restof-Uk",      "email": "Jimmy.Restof-Uk@hmrc.co.uk",      "state": {        "report": {          "GB RTI FPS": {            "Starter": "2018-01-01"          }        },        "actual_t": "2019-02-28",        "pay_graph": {          "": {            "Net pay.YTD": 14974.68,            "Gross pay.YTD": 20400.0          },          "NIC": {            "Employee.YTD": 1437.1200000000001,            "Employer.YTD": 1652.64,            "Current Letter": "A",            "Letters and Values": "[{"GP": "1700.00", "GP-YTD": "20400.00", "LEL-YTD": "6036.00", "LEL-PT-YTD": "2388.00", "PT-UEL-YTD": "11976.00", "Er": "137.72", "Er-YTD": "1652.64", "Ee": "119.76", "Ee-YTD": "1437.12", "Letter": "A"}]"          },          "PAYE": {            "W1_M1": false,            "PBIK-YTD": 0.0,            "Tax code": "45L",            "Tax paid.YTD": 3988.2,            "Gross pay, YTD": 20400.0,            "Taxable pay.YTD": 20400.0,            "Starting declaration": ""          }        }      },      "title": 1,      "groups": [],      "mobile": "+447000123456",      "company": 112,      "end_date": "2019-04-05",      "is_staff": false,      "password": "pbkdf2_sha256$120000$KHRUWPqJ8SBk$eCCUY4MHB3pnsDAlyC514jRKuTUe4M8HE5RHoAeY5qQ=",      "user_ptr": 293,      "pay_graph": 2,      "taxdetail": {        "id": 212,        "gender": "M",        "employee": 293,        "NI_number": "KC489444C",        "NI_category": "General",        "P45_tax_code": null,        "student_loan": 0,        "week1_month1": false,        "date_of_birth": "1995-08-14",        "SL_start_notice": 0,        "tax_code_notice": "45L",        "P45_leaving_date": null,        "company_director": false,        "employee_statement": null,        "weekly_hours_worked": "D",        "P45_total_pay_to_date": null,        "P45_total_tax_to_date": null,        "company_director_from": null,        "employeetaxdetail_ptr": 212,        "Director_NI_cumulative": false,        "employeetaxeedetail_ptr": 212,        "P45_continue_student_loan": 0      },      "bankdetail": {        "id": 202,        "employee": 293,        "sort_code": "162534",        "account_name": "Jimmy Restof-Uk",        "account_number": "12345678",        "employeebankdetail_ptr": 202      },      "department": 129,      "last_login": "2018-12-08T14:22:43.048Z",      "start_date": "2018-01-01",      "employee_id": "TAX1",      "cost_centres": [],      "ee_tax_basis": "(A) 45L",      "is_superuser": false,      "postaldetail": {        "id": 212,        "line1": "1 Tax Test Road",        "line2": "PAYE Town",        "line3": "",        "line4": "",        "employee": 293,        "postcode": "BN1 1YD",        "employeepostaldetail_ptr": 212      },      "pay_after_end": "",      "test_employee": false,      "ee_bank_account": "162534 12345678",      "participant_ptr": 293,      "ee_tax_reference": "KC489444C",      "pay_graph_inputs": {        "Salary": {          "id": 967,          "Base Salary": 20400        }      },      "user_permissions": [],      "pay_graph_outputs": {        "NIC": {          "Employee NIC": -119.76,          "Employer NIC": -137.72        },        "PAYE": {          "Tax Deduction": -332.4        },        "Salary": {          "Pay, base": 1700.0        }      },      "pay_graph_results": {        "PE": 1700.0,        "QE": 1700.0,        "nic_ee": -119.76,        "nic_er": -137.72,        "nic_gp": 1700.0,        "net_pay": 1247.8400000000001,        "paye_gp": 1700.0,        "gross_pay": 1700.0,        "income_tax": -332.4,        "bonus_eligible_pay": 1700.0      }    }  }}[/code]

 

Link to comment
Share on other sites

  • 1 year later...

You could do:

((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("employee") or

((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("employee")

Depending if your report data adapter query type is on JSON or jsonql

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