简体   繁体   English

如何在 iReport Designer 5.6.0 中使用 json 数据文件

[英]How to use a json data file in iReport Designer 5.6.0

I had just downloaded iReport 5.6.0 .我刚刚下载了iReport 5.6.0 But unable to load any JSON file parameters on top of the report.但无法在报告顶部加载任何 JSON 文件参数。

I didn't find any good help online related with this.我没有在网上找到与此相关的任何好的帮助。 I find some help from the url as below:-我从以下网址中找到了一些帮助:-

http://community.jaspersoft.com/wiki/how-query-file-based-json-datasource http://community.jaspersoft.com/wiki/how-query-file-based-json-datasource

But from the above steps I didn't know where to write query in "report query" and to manually create fields, matching names of our json data.但是从上面的步骤我不知道在“报告查询”中在哪里编写查询并手动创建字段,匹配我们的 json 数据的名称。

Please help to load data from JSON datasource.请帮助从 JSON 数据源加载数据。

A little bit late, but here are directtions.有点晚了,但这里有指示。

1) Click Report Datasource button in iReport Designer: 1) 在 iReport Designer 中点击 Report Datasource 按钮:

在此处输入图片说明

2) Click "New", select "JSON datasource, click "Next" 2)点击“新建”,选择“JSON数据源”,点击“下一步”

3) Give it Name, browse to a json file, click "Test" to check: 3)给它命名,浏览到一个json文件,点击“测试”检查:

在此处输入图片说明

json.txt: json.txt:

[
{ "id": 123, "name": "abc" },
{ "id": 456, "name": "def" }
]

4) Add fields manually, use proper types and put onto the report page: 4)手动添加字段,使用适当的类型并放入报表页面:

在此处输入图片说明

5) Generate preview: 5)生成预览:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM