报表数据源配置

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq3399013670/article/details/79170995
  1. jdbc连接
    选择jdbc,注意导入jdbc的驱动jar包即可。

  2. script连接
    open里代码设置

importPackage(Packages.org.apache.http.client.methods)
importPackage(Packages.org.apache.http.impl.client)
importPackage(Packages.org.apache.http.util)
importPackage(Packages.org.apache.http.entity)
importPackage(Packages.org.apache.http.client)
importPackage(Packages.org.apache.http)
importPackage(Packages.net.minidev.json)
importPackage(Packages.java.util)
importPackage(Packages.java.text)
var year = params["paramYear"].value;
client = new DefaultHttpClient();
var fmt = new SimpleDateFormat("yyyy-MM-dd");
var c = Calendar.getInstance();
c.set(Calendar.YEAR, year);
c.set(Calendar.MONTH, 0);
c.set(Calendar.DAY_OF_MONTH, 1);
var startDate = fmt.format(c.getTime());
c.set(Calendar.MONTH, 11);
c.set(Calendar.DAY_OF_MONTH, 30);
var endDate = fmt.format(c.getTime());
var get = new HttpGet("http://**地址***/**地址*/"+startDate+"/"+endDate);
var responseContent = null;
response = client.execute(get);
if (response.getStatusLine().getStatusCode() == 200) {
    responseContent = EntityUtils.toString(response.getEntity(), "UTF-8");
}
var jsonBandwidth = JSONValue.parse(responseContent);
itorFalut = jsonBandwidth.iterator();

colse里代码设置

  if (response != null) {
    response.close();
}
if (client != null) {
    client.close();
}

fetch获

(itorFalut.hasNext()) {
    var obj = itorFalut.next();
    row["id"] = obj.get("id");
    row["name"] = obj.get("name");
    return true;
} else {
    return false;
}

注意:open里设计如下几个jar包:jar包,jar包在服务器webapps下查找可以新建文件夹放在
OLAP Schemas目录下,新建一个文件夹放入即可。
image

3.webService连接
Soap Request代码详细

<?xml version="1.0"?>
<soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:api="http://**url设置***/">
   <soapenv:Header/>
   <soapenv:Body>
      <api:getEmps/>
   </soapenv:Body>
</soapenv:Envelope>
阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页