Page 1 of 2
json data source binding
Posted: Sat Mar 05, 2016 7:35 am
by heqichao
hello stimulsoft
I use stimulsoft reports java on my project,and I want to use json data as data source , but I dont know how to bind the data on the GUI such as the json is : {
"weatherinfo": {
"city": "beijing",
"cityid": "101010100",
"temp": "18",
"WS": "one",
"SD": "17%",
"WSE": "1",
"time": "17:05",
"isRadar": "1",
"Radar": "JC_RADAR_AZ9010_JB",
"qy": "1011",
"rain": "0"
}
}
I dont understand how to use it on the text expression .
Looking forward to your reply,thanks
Re: json data source binding
Posted: Mon Mar 07, 2016 7:54 am
by HighAley
Hello.
Sorry, for delay with answer.
We need additional time to prepare it.
Thank you.
Re: json data source binding
Posted: Mon Mar 07, 2016 10:25 am
by heqichao
Thanks for your response/reply,I am looking forward to the json data demo ,and I have other questions:
1、How to export the pdf file on java code
2、On the Chinese Disorder Code preview as pdf
thank you.
Re: json data source binding
Posted: Wed Mar 09, 2016 7:09 am
by Vadim
Hello.
To use JSON datasource you can do next way:
1. Add new connection
2. Select JSON Data
3. On filed "Path to JSON Data" you can write JSON-file path or url to JSON data.

- 1.png (30.56 KiB) Viewed 7591 times
For export PDF (and in Chinese) you can use next code:
Code: Select all
StiExportManager.exportPdf(StiReport, StiPdfExportSettings, OutputStream);
Re: json data source binding
Posted: Wed Mar 09, 2016 12:11 pm
by heqichao
Hello, thanks for you reply.
I have set the json data source (
http://img.hoop8.com/attachments/1603/2053528282908.png)
, and the json is {"aaa":{"s1":"s1","s2":"s2"}}, but in the TEXT, how to binding the json s2 ? {aaa.s2} is not work.
thank
Re: json data source binding
Posted: Wed Mar 09, 2016 12:14 pm
by heqichao
Hello, thanks for you reply.
I have set the json data source

(
http://img.hoop8.com/attachments/1603/6443528282908.png)
, and the json is {"aaa":{"s1":"s1","s2":"s2"}}, but in the TEXT, how to binding the json s2 ? {aaa.s2} is not work.
thank
Re: json data source binding
Posted: Thu Mar 10, 2016 11:09 am
by Vadim
Hello.
This will be fixed in tomorrow pre-release build 2016.1.3
Re: json data source binding
Posted: Tue Mar 15, 2016 6:17 am
by heqichao
Re: json data source binding
Posted: Tue Mar 15, 2016 10:59 am
by Vadim
Hello.
You use wrong JSON format. Your JSON must look like:
{"weatherinfo":[{"city":"??","cityid":"101010100","temp1":"-2?","temp2":"16?","weather":"?","img1":"n0.gif","img2":"d0.gif","ptime":"18:00"}]}
Here other example
http://northwind.servicestack.net/query/customers.json
Re: json data source binding
Posted: Tue Mar 15, 2016 11:29 am
by heqichao
Thanks ! It is working !
can you show me the java code to set the json datasource?