获取

说明

integer/array report.get(object parameters)

该方法帮助用户根据所提供的参数来检索计划报表。

该方法可供所有类型的用户使用。 用户可以在用户角色设置中对该方式的使用权限进行设定修改。请参考 用户角色以获取更多信息。

参数

(object) 定义了需求输出的参数。

该方法支持如下参数。

参数 类型 说明
reportids ID/array 根据指定的ID返回对应计划报表。
expired boolean 若设定为true则只返回失效的计划报表,若设定为false,则只返回有效的计划报表。
selectUsers query 返回报告所设定的发送目标的用户属性。
selectUserGroups query 返回报告所定的发送目标的用户组 属性。
sortfield string/array 设定属性参数用来分类返回数据。

可设定的参数包括:reportid, name, status.
countOutput boolean 该类参数在所有的get方法中应用广泛,用户可以参考引用评论 页面来获取更多详细信息。
excludeSearch boolean
filter object
limit integer
output query
preservekeys boolean
search object
searchByAny boolean
searchWildcardsEnabled boolean
sortorder string/array
startSearch boolean

返回值

(integer/array) 返回下列两种数值之一:

  • 一组对象;
  • countOutput参数应用的情况下,返回检索对象的数量。

参考示例

检索报告数据

请求:

{
           "jsonrpc": "2.0",
           "method": "report.get",
           "params": [
               "output" :  "extend",
               "selectUsers" : "extend",
               "selectUserGroups" : "extend",
               "reportids" :  ["1", "2"]
           ],
           "id": 1
       }

响应:

{
           "jsonrpc": "2.0",
           "result": [{
               "reportid": "1",
               "userid": "1",
               "name": "Weekly report",
               "dashboardid": "1",
               "period": "1",
               "cycle": "1",
               "start_time": "43200",
               "weekdays": "31",
               "active_since": "2021-04-01",
               "active_till": "2021-08-31",
               "subject": "Weekly report",
               "message": "Report accompanying text",
               "status": "1",
               "description": "Report description",
               "state": "1",
               "lastsent": "1613563219",
               "info": "",
               "users": [{
                   "userid": "1",
                   "access_userid": "1",
                   "exclude": "0"
               }, {
                   "userid": "2",
                   "access_userid": "0",
                   "exclude": "1"
               }],
               "user_groups": [{
                   "usrgrpid": "7",
                   "access_userid": "0"
               }]
           }, {
               "reportid": "2",
               "userid": "1",
               "name": "Monthly report",
               "dashboardid": "2",
               "period": "2",
               "cycle": "2",
               "start_time": "0",
               "weekdays": "0",
               "active_since": "2021-05-01",
               "active_till": "",
               "subject": "Monthly report",
               "message": "Report accompanying text",
               "status": "1",
               "description": "",
               "state": "0",
               "lastsent": "0",
               "info": "",
               "users": [{
                   "userid": "1",
                   "access_userid": "1",
                   "exclude": "0"
               }],
               "user_groups": []
           }],
           "id": 1
       }

另请参考

参考来源

CReport::get() in ui/include/classes/api/services/CReport.php.