Jasperreports - 如何让JSON填充子报表 [英] Jasperreports - how to get JSON to populate a subreport

查看:105
本文介绍了Jasperreports - 如何让JSON填充子报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Jasper / iReport在主报表中填充相同数据的表格。我如何让Json继续?

I am trying to get a table to populate with the same data in my main report using Jasper/iReport. How can I get the Json to carry over?

在编辑表数据源中我尝试过:

In Edit table datasource I've tried:

((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE})

new ((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE})

$P{REPORT_DATA_SOURCE}

$P{REPORT_CONNECTION}

所有这些都编译,但没有一个实际生成表。有任何想法吗?对于JSON,没有类似cloneDataSource()的方法,那么替代方案是什么?

All of which compile, but none of which actually generate a table. Any ideas? There is no method like cloneDataSource() for JSON so what is the alternative?

我的最终目标很简单:传入JSON数据并使用它来生成图表,然后有一个显示相同信息的表。我已经在这方面工作了几天,贾斯帕给了我一个艰难的时刻。请帮忙!

My ultimate goal is simple: to pass in JSON data and use it to generate a chart, and then have a table displaying the same information. I have been working for days on this, Jasper is giving me a hard time. Please help!

推荐答案

在使用子报告时,我遇到了类似的问题。似乎JSON数据源被主报告使用,因此您需要调用 subDataSource()来获取子报告的新数据源,也可能用于表格 - 避风港虽然测试了但是......

I was struggling with a similar problem when using sub reports. It seems that the JSON datasource gets consumed by the main report so you need to invoke subDataSource() to get a fresh datasource for your sub reports and maybe for tables, too - haven't tested that yet though...

数据源表达式:((net.sf.jasperreports.engine.data.JsonDataSource)$ P {REPORT_DATA_SOURCE})。subDataSource()

这篇关于Jasperreports - 如何让JSON填充子报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆