Jump to content
Changes to the Jaspersoft community edition download ×

Simple report with a table from json data


berlin.brown

Recommended Posts

With this simple configuration, I am passing json data to a table.  I see an empty document with this setup.  What is mssing.

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1  --><!-- 2019-04-12T16:26:16 --><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="NewReportPullTable" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bf9e7542-323d-4fb8-bea6-e92da2349533">    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="FincalcLoanAdapter "/>    <style name="Table_TH" mode="Opaque" backcolor="#F0F8FF">        <box>            <pen lineWidth="0.5" lineColor="#000000"/>            <topPen lineWidth="0.5" lineColor="#000000"/>            <leftPen lineWidth="0.5" lineColor="#000000"/>            <bottomPen lineWidth="0.5" lineColor="#000000"/>            <rightPen lineWidth="0.5" lineColor="#000000"/>        </box>    </style>    <style name="Table_CH" mode="Opaque" backcolor="#BFE1FF">        <box>            <pen lineWidth="0.5" lineColor="#000000"/>            <topPen lineWidth="0.5" lineColor="#000000"/>            <leftPen lineWidth="0.5" lineColor="#000000"/>            <bottomPen lineWidth="0.5" lineColor="#000000"/>            <rightPen lineWidth="0.5" lineColor="#000000"/>        </box>    </style>    <style name="Table_TD" mode="Opaque" backcolor="#FFFFFF">        <box>            <pen lineWidth="0.5" lineColor="#000000"/>            <topPen lineWidth="0.5" lineColor="#000000"/>            <leftPen lineWidth="0.5" lineColor="#000000"/>            <bottomPen lineWidth="0.5" lineColor="#000000"/>            <rightPen lineWidth="0.5" lineColor="#000000"/>        </box>    </style>    <subDataset name="Dataset1" uuid="4bf8f7c6-1f32-423a-a26d-c2fb06f19f9c">        <property name="com.jaspersoft.studio.data.defaultdataadapter" value="FincalcLoanAdapter "/>        <queryString language="json">            <![CDATA[]]>        </queryString>        <field name="x" class="java.lang.String">            <property name="net.sf.jasperreports.json.field.expression" value="x"/>            <fieldDescription><![CDATA[x]]></fieldDescription>        </field>        <field name="y" class="java.lang.String">            <property name="net.sf.jasperreports.json.field.expression" value="y"/>            <fieldDescription><![CDATA[y]]></fieldDescription>        </field>    </subDataset>    <queryString language="json">        <![CDATA[]]>    </queryString>    <background>        <band splitType="Stretch"/>    </background>    <title>        <band height="79" splitType="Stretch"/>    </title>    <pageHeader>        <band height="35" splitType="Stretch"/>    </pageHeader>    <columnHeader>        <band height="61" splitType="Stretch"/>    </columnHeader>    <detail>        <band height="266" splitType="Stretch">            <componentElement>                <reportElement x="180" y="30" width="328" height="236" uuid="7271b389-e82a-4720-8296-7e8f73422453">                    <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="Dataset1" uuid="be75df4a-ce1e-4fec-8c1e-a98f7e0bcdb3">                        <datasetParameter name="JSON_INPUT_STREAM">                            <datasetParameterExpression><![CDATA[$P{JSON_INPUT_STREAM}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="net.sf.jasperreports.json.source">                            <datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.json.source}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="net.sf.jasperreports.json.sources">                            <datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.json.sources}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="net.sf.jasperreports.json.date.pattern">                            <datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.json.date.pattern}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="net.sf.jasperreports.json.number.pattern">                            <datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.json.number.pattern}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="JSON_LOCALE">                            <datasetParameterExpression><![CDATA[$P{JSON_LOCALE}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="net.sf.jasperreports.json.locale.code">                            <datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.json.locale.code}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="JSON_TIME_ZONE">                            <datasetParameterExpression><![CDATA[$P{JSON_TIME_ZONE}]]></datasetParameterExpression>                        </datasetParameter>                        <datasetParameter name="net.sf.jasperreports.json.timezone.id">                            <datasetParameterExpression><![CDATA[$P{net.sf.jasperreports.json.timezone.id}]]></datasetParameterExpression>                        </datasetParameter>                        <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>                    </datasetRun>                    <jr:column width="40" uuid="ef1416e4-790a-4527-9302-72d054fdfb83">                        <jr:tableHeader style="Table_TH" height="30"/>                        <jr:tableFooter style="Table_TH" height="30"/>                        <jr:columnHeader style="Table_CH" height="30"/>                        <jr:columnFooter style="Table_CH" height="30"/>                        <jr:detailCell style="Table_TD" height="30"/>                    </jr:column>                </jr:table>            </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>[/code]

 [ {
      "x" : "D",
      "y" : "Z"
   } ]
 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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