Page tree
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Current »

如果业务应用系统不允许报表系统直接访问,只能通过URL形式的调用接口进行访问,那么建议采用JSON类型的数据源。

定义JSON数据源的步骤如下:

(1)在数据源的【提供程序】处选择"Json Provider"。

(2)在【连接字符串】中,输入如下形式的连接字串:

jsondoc=http://localhost:8080/WebApi.asmx/GetDataSetAsJson

schemadata={  "$schema": "http://json-schema.org/draft-04/schema",

 "type": "array",

 "items": {

   "type": "object",

   "properties": {

     "ID": {"type": "integer"},

     "Name": {"type": "string"},

     "BirthDate": {"type": "string"},

     "Position": {"type": "string"},

     "Title": {"type": "string"},

     "Email": {"type": "string"}

   },

   "required": ["ID", "Name", "BirthDate", "Position", "Title", "Email"]

 }

}


其中,

jsondoc指定数据本身来源,一般是一个URL。

schemadata指定格式信息。如果不清楚Schema内容,可通过第三方网站(如http://jsonschema.net)或其他工具,从具体的JSON数据中自动生成Schema内容。


(3)点击【连接测试】按钮验证连接字串的正确性,再点击【保存】按钮。


  • No labels