Why I m getting empty report using a json file as datasource?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I m using tibco jaspersoft studio to generate a report
droping fields in the detail band is getting all data but when I try to use a table I m getting two empty pages.
the printing option is set to print all sections no details
here is my data json file
[
"clientName" : "SEMMOUD Abderrazak",
"clientPhone" : "043303854",
"codeExterne" : "CLI201801",
"email" : "talcorpdz@gmail.com",
"clientType" : 0,
"clientEtat" : 1,
"identifiant" : "TalcorpDZ",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed Housseyn",
"telephonePortable" : "04330256699",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants Mohammed Khemisti",
"ville" : "Maghnia"
]
,
"clientName" : "",
"clientPhone" : "",
"codeExterne" : "sdsqdqs",
"email" : "talcorpdz@gmail.com",
"clientType" : 1,
"clientEtat" : 1,
"identifiant" : "sqdsqd",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed",
"telephonePortable" : "+213778217469",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants ",
"ville" : "Maghnia"
]
]
and here is my report
<?xml version="1.0" encoding="UTF-8"?>
<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="refClient" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="758785c8-ae8f-49bd-9995-19c9827a7ebb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<queryString language="json">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
</subDataset>
<queryString language="JSON">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
<detail>
<band height="258" splitType="Stretch">
<componentElement>
<reportElement x="40" y="10" width="660" height="200" uuid="a43c33cc-e3f9-470c-8df4-1c36301c869e">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
<property name="com.jaspersoft.studio.components.autoresize.next" value="true"/>
</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="jsonRefClient" uuid="b4a19c4b-0cb1-481a-a9ba-739ce437135a">
<connectionExpression><![CDATA[$PREPORT_CONNECTION]]></connectionExpression>
</datasetRun>
<jr:column width="660" uuid="eda57584-75da-466c-8182-d466356f3cc4">
<jr:tableHeader height="30" rowSpan="1"/>
<jr:tableFooter height="30" rowSpan="1"/>
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="660" height="30" uuid="d349739f-3e3d-4012-8e52-3b5c7bd75eb9"/>
<text><![CDATA[clientName]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter height="30" rowSpan="1"/>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="660" height="30" uuid="fb6bb53f-e520-48f4-81e0-189ae5058656"/>
<textFieldExpression><![CDATA[$FclientName]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
What should I do to fix this issue?
json jasper-reports
add a comment |
I m using tibco jaspersoft studio to generate a report
droping fields in the detail band is getting all data but when I try to use a table I m getting two empty pages.
the printing option is set to print all sections no details
here is my data json file
[
"clientName" : "SEMMOUD Abderrazak",
"clientPhone" : "043303854",
"codeExterne" : "CLI201801",
"email" : "talcorpdz@gmail.com",
"clientType" : 0,
"clientEtat" : 1,
"identifiant" : "TalcorpDZ",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed Housseyn",
"telephonePortable" : "04330256699",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants Mohammed Khemisti",
"ville" : "Maghnia"
]
,
"clientName" : "",
"clientPhone" : "",
"codeExterne" : "sdsqdqs",
"email" : "talcorpdz@gmail.com",
"clientType" : 1,
"clientEtat" : 1,
"identifiant" : "sqdsqd",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed",
"telephonePortable" : "+213778217469",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants ",
"ville" : "Maghnia"
]
]
and here is my report
<?xml version="1.0" encoding="UTF-8"?>
<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="refClient" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="758785c8-ae8f-49bd-9995-19c9827a7ebb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<queryString language="json">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
</subDataset>
<queryString language="JSON">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
<detail>
<band height="258" splitType="Stretch">
<componentElement>
<reportElement x="40" y="10" width="660" height="200" uuid="a43c33cc-e3f9-470c-8df4-1c36301c869e">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
<property name="com.jaspersoft.studio.components.autoresize.next" value="true"/>
</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="jsonRefClient" uuid="b4a19c4b-0cb1-481a-a9ba-739ce437135a">
<connectionExpression><![CDATA[$PREPORT_CONNECTION]]></connectionExpression>
</datasetRun>
<jr:column width="660" uuid="eda57584-75da-466c-8182-d466356f3cc4">
<jr:tableHeader height="30" rowSpan="1"/>
<jr:tableFooter height="30" rowSpan="1"/>
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="660" height="30" uuid="d349739f-3e3d-4012-8e52-3b5c7bd75eb9"/>
<text><![CDATA[clientName]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter height="30" rowSpan="1"/>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="660" height="30" uuid="fb6bb53f-e520-48f4-81e0-189ae5058656"/>
<textFieldExpression><![CDATA[$FclientName]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
What should I do to fix this issue?
json jasper-reports
@Alex K, you have not properly edited the report JRXML and it is now in an uncompilable state.
– Narcis
Nov 15 '18 at 20:32
It is a problem, indeed, with huge templates and unnecessary code. Most people don't even bother reading the mcve. But I find it hard, sometimes, to cleanup a report from within JSS, so I do it manually instead. And I don't think that's easy for everyone.
– Narcis
Nov 16 '18 at 8:24
add a comment |
I m using tibco jaspersoft studio to generate a report
droping fields in the detail band is getting all data but when I try to use a table I m getting two empty pages.
the printing option is set to print all sections no details
here is my data json file
[
"clientName" : "SEMMOUD Abderrazak",
"clientPhone" : "043303854",
"codeExterne" : "CLI201801",
"email" : "talcorpdz@gmail.com",
"clientType" : 0,
"clientEtat" : 1,
"identifiant" : "TalcorpDZ",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed Housseyn",
"telephonePortable" : "04330256699",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants Mohammed Khemisti",
"ville" : "Maghnia"
]
,
"clientName" : "",
"clientPhone" : "",
"codeExterne" : "sdsqdqs",
"email" : "talcorpdz@gmail.com",
"clientType" : 1,
"clientEtat" : 1,
"identifiant" : "sqdsqd",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed",
"telephonePortable" : "+213778217469",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants ",
"ville" : "Maghnia"
]
]
and here is my report
<?xml version="1.0" encoding="UTF-8"?>
<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="refClient" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="758785c8-ae8f-49bd-9995-19c9827a7ebb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<queryString language="json">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
</subDataset>
<queryString language="JSON">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
<detail>
<band height="258" splitType="Stretch">
<componentElement>
<reportElement x="40" y="10" width="660" height="200" uuid="a43c33cc-e3f9-470c-8df4-1c36301c869e">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
<property name="com.jaspersoft.studio.components.autoresize.next" value="true"/>
</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="jsonRefClient" uuid="b4a19c4b-0cb1-481a-a9ba-739ce437135a">
<connectionExpression><![CDATA[$PREPORT_CONNECTION]]></connectionExpression>
</datasetRun>
<jr:column width="660" uuid="eda57584-75da-466c-8182-d466356f3cc4">
<jr:tableHeader height="30" rowSpan="1"/>
<jr:tableFooter height="30" rowSpan="1"/>
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="660" height="30" uuid="d349739f-3e3d-4012-8e52-3b5c7bd75eb9"/>
<text><![CDATA[clientName]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter height="30" rowSpan="1"/>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="660" height="30" uuid="fb6bb53f-e520-48f4-81e0-189ae5058656"/>
<textFieldExpression><![CDATA[$FclientName]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
What should I do to fix this issue?
json jasper-reports
I m using tibco jaspersoft studio to generate a report
droping fields in the detail band is getting all data but when I try to use a table I m getting two empty pages.
the printing option is set to print all sections no details
here is my data json file
[
"clientName" : "SEMMOUD Abderrazak",
"clientPhone" : "043303854",
"codeExterne" : "CLI201801",
"email" : "talcorpdz@gmail.com",
"clientType" : 0,
"clientEtat" : 1,
"identifiant" : "TalcorpDZ",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed Housseyn",
"telephonePortable" : "04330256699",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants Mohammed Khemisti",
"ville" : "Maghnia"
]
,
"clientName" : "",
"clientPhone" : "",
"codeExterne" : "sdsqdqs",
"email" : "talcorpdz@gmail.com",
"clientType" : 1,
"clientEtat" : 1,
"identifiant" : "sqdsqd",
"contacts" : [
"nom" : "Taleb",
"prenom" : "Mohammed",
"telephonePortable" : "+213778217469",
"email" : null
],
"adresses" : [
"adress" : "Batiments des enseignants ",
"ville" : "Maghnia"
]
]
and here is my report
<?xml version="1.0" encoding="UTF-8"?>
<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="refClient" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" whenResourceMissingType="Empty" uuid="758785c8-ae8f-49bd-9995-19c9827a7ebb">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="refcliJsonAdapter"/>
<queryString language="json">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
</subDataset>
<queryString language="JSON">
<![CDATA]>
</queryString>
<field name="clientName" class="java.lang.String">
<property name="net.sf.jasperreports.json.field.expression" value="clientName"/>
<fieldDescription><![CDATA[clientName]]></fieldDescription>
</field>
<detail>
<band height="258" splitType="Stretch">
<componentElement>
<reportElement x="40" y="10" width="660" height="200" uuid="a43c33cc-e3f9-470c-8df4-1c36301c869e">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.components.autoresize.proportional" value="true"/>
<property name="com.jaspersoft.studio.components.autoresize.next" value="true"/>
</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="jsonRefClient" uuid="b4a19c4b-0cb1-481a-a9ba-739ce437135a">
<connectionExpression><![CDATA[$PREPORT_CONNECTION]]></connectionExpression>
</datasetRun>
<jr:column width="660" uuid="eda57584-75da-466c-8182-d466356f3cc4">
<jr:tableHeader height="30" rowSpan="1"/>
<jr:tableFooter height="30" rowSpan="1"/>
<jr:columnHeader height="30" rowSpan="1">
<staticText>
<reportElement x="0" y="0" width="660" height="30" uuid="d349739f-3e3d-4012-8e52-3b5c7bd75eb9"/>
<text><![CDATA[clientName]]></text>
</staticText>
</jr:columnHeader>
<jr:columnFooter height="30" rowSpan="1"/>
<jr:detailCell height="30">
<textField>
<reportElement x="0" y="0" width="660" height="30" uuid="fb6bb53f-e520-48f4-81e0-189ae5058656"/>
<textFieldExpression><![CDATA[$FclientName]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</band>
</detail>
</jasperReport>
What should I do to fix this issue?
json jasper-reports
json jasper-reports
edited Nov 15 '18 at 20:53
Alex K
18.7k1483169
18.7k1483169
asked Nov 15 '18 at 13:49
Mohammed Housseyn TalebMohammed Housseyn Taleb
7621128
7621128
@Alex K, you have not properly edited the report JRXML and it is now in an uncompilable state.
– Narcis
Nov 15 '18 at 20:32
It is a problem, indeed, with huge templates and unnecessary code. Most people don't even bother reading the mcve. But I find it hard, sometimes, to cleanup a report from within JSS, so I do it manually instead. And I don't think that's easy for everyone.
– Narcis
Nov 16 '18 at 8:24
add a comment |
@Alex K, you have not properly edited the report JRXML and it is now in an uncompilable state.
– Narcis
Nov 15 '18 at 20:32
It is a problem, indeed, with huge templates and unnecessary code. Most people don't even bother reading the mcve. But I find it hard, sometimes, to cleanup a report from within JSS, so I do it manually instead. And I don't think that's easy for everyone.
– Narcis
Nov 16 '18 at 8:24
@Alex K, you have not properly edited the report JRXML and it is now in an uncompilable state.
– Narcis
Nov 15 '18 at 20:32
@Alex K, you have not properly edited the report JRXML and it is now in an uncompilable state.
– Narcis
Nov 15 '18 at 20:32
It is a problem, indeed, with huge templates and unnecessary code. Most people don't even bother reading the mcve. But I find it hard, sometimes, to cleanup a report from within JSS, so I do it manually instead. And I don't think that's easy for everyone.
– Narcis
Nov 16 '18 at 8:24
It is a problem, indeed, with huge templates and unnecessary code. Most people don't even bother reading the mcve. But I find it hard, sometimes, to cleanup a report from within JSS, so I do it manually instead. And I don't think that's easy for everyone.
– Narcis
Nov 16 '18 at 8:24
add a comment |
1 Answer
1
active
oldest
votes
Your table dataSet is not actually linked to any data, at runtime. A quick fix is to:
- Export your JSON Data Adapter to a file on the same level as your report, let's say refcliJsonAdapter.xml
Add the
net.sf.jasperreports.data.adapterproperty to your table dataSet, something like:<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
...
<property name="net.sf.jasperreports.data.adapter" value="refcliJsonAdapter.xml"/>
...
</subDataset>Preview the report against the
One Empty Recordbuilt-in Data Adapter if you don't want repeating tables.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320923%2fwhy-i-m-getting-empty-report-using-a-json-file-as-datasource%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Your table dataSet is not actually linked to any data, at runtime. A quick fix is to:
- Export your JSON Data Adapter to a file on the same level as your report, let's say refcliJsonAdapter.xml
Add the
net.sf.jasperreports.data.adapterproperty to your table dataSet, something like:<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
...
<property name="net.sf.jasperreports.data.adapter" value="refcliJsonAdapter.xml"/>
...
</subDataset>Preview the report against the
One Empty Recordbuilt-in Data Adapter if you don't want repeating tables.
add a comment |
Your table dataSet is not actually linked to any data, at runtime. A quick fix is to:
- Export your JSON Data Adapter to a file on the same level as your report, let's say refcliJsonAdapter.xml
Add the
net.sf.jasperreports.data.adapterproperty to your table dataSet, something like:<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
...
<property name="net.sf.jasperreports.data.adapter" value="refcliJsonAdapter.xml"/>
...
</subDataset>Preview the report against the
One Empty Recordbuilt-in Data Adapter if you don't want repeating tables.
add a comment |
Your table dataSet is not actually linked to any data, at runtime. A quick fix is to:
- Export your JSON Data Adapter to a file on the same level as your report, let's say refcliJsonAdapter.xml
Add the
net.sf.jasperreports.data.adapterproperty to your table dataSet, something like:<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
...
<property name="net.sf.jasperreports.data.adapter" value="refcliJsonAdapter.xml"/>
...
</subDataset>Preview the report against the
One Empty Recordbuilt-in Data Adapter if you don't want repeating tables.
Your table dataSet is not actually linked to any data, at runtime. A quick fix is to:
- Export your JSON Data Adapter to a file on the same level as your report, let's say refcliJsonAdapter.xml
Add the
net.sf.jasperreports.data.adapterproperty to your table dataSet, something like:<subDataset name="jsonRefClient" whenResourceMissingType="Empty" uuid="1dcb37f4-96e4-472a-aadb-309de9d05089">
...
<property name="net.sf.jasperreports.data.adapter" value="refcliJsonAdapter.xml"/>
...
</subDataset>Preview the report against the
One Empty Recordbuilt-in Data Adapter if you don't want repeating tables.
answered Nov 15 '18 at 20:47
NarcisNarcis
1,6062717
1,6062717
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53320923%2fwhy-i-m-getting-empty-report-using-a-json-file-as-datasource%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
@Alex K, you have not properly edited the report JRXML and it is now in an uncompilable state.
– Narcis
Nov 15 '18 at 20:32
It is a problem, indeed, with huge templates and unnecessary code. Most people don't even bother reading the mcve. But I find it hard, sometimes, to cleanup a report from within JSS, so I do it manually instead. And I don't think that's easy for everyone.
– Narcis
Nov 16 '18 at 8:24