crosstab in jasper displays only the first column from input json
my json is as follows
"values": [
"purchase":
"name":"bags"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
"purchase":
"name":"shoes"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
]
I want to displayed the grid where rows are
productname and (columns by weekstartdate)
I followed the technique provided in How to show column at Crosstab even the data is absent
However the productname are listed in row but the column are showing only first column.
my data set is as follows
<queryString language="jsonql">
<![CDATA]>
</queryString>
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="product.name"/>
<fieldDescription><![CDATA[product.name]]></fieldDescription>
</field>
<field name="weekStartDate" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekSpend.weekStartDate"/>
</field>
<group name="activityDateGroup">
<groupExpression><![CDATA[$FweekStartDate]]></groupExpression>
</group>
my crossdata datasource is as follows
<crosstabDataset isDataPreSorted="true">
<dataset>
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0).*")]]></dataSourceExpression>
</datasetRun>
</dataset>
</crosstabDataset>
and bucketexpression is on weekstartdate.
With these using JsonQL still only the first column is displayed
How do i get list of column based on weekstardate from iterating from rootnode.
i am using jasper studio 6.5.
Thanks
Anjana.
json jasper-reports json-query
add a comment |
my json is as follows
"values": [
"purchase":
"name":"bags"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
"purchase":
"name":"shoes"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
]
I want to displayed the grid where rows are
productname and (columns by weekstartdate)
I followed the technique provided in How to show column at Crosstab even the data is absent
However the productname are listed in row but the column are showing only first column.
my data set is as follows
<queryString language="jsonql">
<![CDATA]>
</queryString>
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="product.name"/>
<fieldDescription><![CDATA[product.name]]></fieldDescription>
</field>
<field name="weekStartDate" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekSpend.weekStartDate"/>
</field>
<group name="activityDateGroup">
<groupExpression><![CDATA[$FweekStartDate]]></groupExpression>
</group>
my crossdata datasource is as follows
<crosstabDataset isDataPreSorted="true">
<dataset>
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0).*")]]></dataSourceExpression>
</datasetRun>
</dataset>
</crosstabDataset>
and bucketexpression is on weekstartdate.
With these using JsonQL still only the first column is displayed
How do i get list of column based on weekstardate from iterating from rootnode.
i am using jasper studio 6.5.
Thanks
Anjana.
json jasper-reports json-query
add a comment |
my json is as follows
"values": [
"purchase":
"name":"bags"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
"purchase":
"name":"shoes"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
]
I want to displayed the grid where rows are
productname and (columns by weekstartdate)
I followed the technique provided in How to show column at Crosstab even the data is absent
However the productname are listed in row but the column are showing only first column.
my data set is as follows
<queryString language="jsonql">
<![CDATA]>
</queryString>
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="product.name"/>
<fieldDescription><![CDATA[product.name]]></fieldDescription>
</field>
<field name="weekStartDate" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekSpend.weekStartDate"/>
</field>
<group name="activityDateGroup">
<groupExpression><![CDATA[$FweekStartDate]]></groupExpression>
</group>
my crossdata datasource is as follows
<crosstabDataset isDataPreSorted="true">
<dataset>
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0).*")]]></dataSourceExpression>
</datasetRun>
</dataset>
</crosstabDataset>
and bucketexpression is on weekstartdate.
With these using JsonQL still only the first column is displayed
How do i get list of column based on weekstardate from iterating from rootnode.
i am using jasper studio 6.5.
Thanks
Anjana.
json jasper-reports json-query
my json is as follows
"values": [
"purchase":
"name":"bags"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
"purchase":
"name":"shoes"
,
"weekSpend": [
"weekStartDate": 20181105,
"spend":100
,
"weekStartDate": 20181112,
"spend":200
]
,
]
I want to displayed the grid where rows are
productname and (columns by weekstartdate)
I followed the technique provided in How to show column at Crosstab even the data is absent
However the productname are listed in row but the column are showing only first column.
my data set is as follows
<queryString language="jsonql">
<![CDATA]>
</queryString>
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="product.name"/>
<fieldDescription><![CDATA[product.name]]></fieldDescription>
</field>
<field name="weekStartDate" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekSpend.weekStartDate"/>
</field>
<group name="activityDateGroup">
<groupExpression><![CDATA[$FweekStartDate]]></groupExpression>
</group>
my crossdata datasource is as follows
<crosstabDataset isDataPreSorted="true">
<dataset>
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0).*")]]></dataSourceExpression>
</datasetRun>
</dataset>
</crosstabDataset>
and bucketexpression is on weekstartdate.
With these using JsonQL still only the first column is displayed
How do i get list of column based on weekstardate from iterating from rootnode.
i am using jasper studio 6.5.
Thanks
Anjana.
json jasper-reports json-query
json jasper-reports json-query
edited Nov 12 '18 at 6:04
Alex K
18.5k1480162
18.5k1480162
asked Nov 12 '18 at 3:55
AnjanaAnjana
297
297
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
There is an invalid field mapping: weekStartDate
to java.lang.String
, that is not supported in JSONQL.
Instead you could have this subDataset expression:
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0)..weekSpend.*")]]></dataSourceExpression>
</datasetRun>
with these field mappings:
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="^2.purchase.name"/>
</field>
<field name="weekStartDate" class="java.lang.Integer">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekStartDate"/>
</field>
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
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%2f53255763%2fcrosstab-in-jasper-displays-only-the-first-column-from-input-json%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
There is an invalid field mapping: weekStartDate
to java.lang.String
, that is not supported in JSONQL.
Instead you could have this subDataset expression:
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0)..weekSpend.*")]]></dataSourceExpression>
</datasetRun>
with these field mappings:
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="^2.purchase.name"/>
</field>
<field name="weekStartDate" class="java.lang.Integer">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekStartDate"/>
</field>
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
add a comment |
There is an invalid field mapping: weekStartDate
to java.lang.String
, that is not supported in JSONQL.
Instead you could have this subDataset expression:
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0)..weekSpend.*")]]></dataSourceExpression>
</datasetRun>
with these field mappings:
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="^2.purchase.name"/>
</field>
<field name="weekStartDate" class="java.lang.Integer">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekStartDate"/>
</field>
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
add a comment |
There is an invalid field mapping: weekStartDate
to java.lang.String
, that is not supported in JSONQL.
Instead you could have this subDataset expression:
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0)..weekSpend.*")]]></dataSourceExpression>
</datasetRun>
with these field mappings:
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="^2.purchase.name"/>
</field>
<field name="weekStartDate" class="java.lang.Integer">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekStartDate"/>
</field>
There is an invalid field mapping: weekStartDate
to java.lang.String
, that is not supported in JSONQL.
Instead you could have this subDataset expression:
<datasetRun subDataset="crossTabDataSet" uuid="e7b27508-8a48-4785-a48e-c646249df9a9">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonQLDataSource)$PREPORT_DATA_SOURCE).subDataSource("..values(@size > 0)..weekSpend.*")]]></dataSourceExpression>
</datasetRun>
with these field mappings:
<field name="productName" class="java.lang.String">
<property name="net.sf.jasperreports.jsonql.field.expression" value="^2.purchase.name"/>
</field>
<field name="weekStartDate" class="java.lang.Integer">
<property name="net.sf.jasperreports.jsonql.field.expression" value="weekStartDate"/>
</field>
answered Nov 12 '18 at 10:47
NarcisNarcis
1,5982717
1,5982717
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
add a comment |
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
Thanks Narcis, This worked and i am able to get the columns displays
– Anjana
Nov 12 '18 at 14:52
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
however encountered another with nested subdataset in crosstab. posted details at stackoverflow.com/questions/53264657/….
– Anjana
Nov 12 '18 at 14:53
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%2f53255763%2fcrosstab-in-jasper-displays-only-the-first-column-from-input-json%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