天心天思技术部 发表于 2021-9-23 11:06:34

ActiveReport15 JSON 提供程序如何访问授权REST API

AR中JSON 提供程序如何才能访问授权REST API,看文档只支持GET 请求API,没有办法配置请求的Headers.

James.Lv 发表于 2021-9-23 11:06:35

您好,json数据源可以使用表达式,schemadata可以根据需要进行添加,可以参考附件的报表,表达式内容如下:
method=GET;headers={"AuthToken":"F2B4D68C726D606AE816BBBABD98D89E02C7C4BFAD512CA3804135DF73F28A1798F6B8C91F9C76C4FF8ADFDEDAF2E021BBF30FA4B5FB36297947AE509892A7F73860FFD84D4E4B4469E168143E27BEE8545FB71D5F105F0B263825621D77C7665E3DADE8C0953FEC489C1A74736D92C21126C021390B6A57F67564F797BE2F4E70BB7B52F7F356C61A85405E16ECA0DC85C5C4284DBCDADC8280750D3C0F6B5B9FC09FAFA9C732630414CA056A676B818B291B155E0EA493999387F76EC0EB0D6B343DCCDCF05B084752EA649155924CE2B540A26BA35672E2FC781E7C475061D92A9365C503EAF9A7141BE5AE64A6A89B2A387591733EC40B7B24E90CADD440D0BFE82C377CAC0F516DFF14F78BE0281EA18FC7CB2EDC3C4994DCC1240C5ABD5215C3F8BF6E7A7226C12A7116A076FAg"};jsondoc=http://localhost:8080/api/reports;schemadata={    "$schema": "http://json-schema.org/draft-04/schema#",    "definitions": {},    "id": "http://example.com/example.json",    "items": {      "id": "/items",      "properties": {            "$effectivePermissions": {                "id": "/items/properties/$effectivePermissions",                "type": "string"            },            "$metadata": {                "id": "/items/properties/$metadata",                "properties": {                  "Comment": {                        "id": "/items/properties/$metadata/properties/Comment",                        "type": "string"                  },                  "Created": {                        "id": "/items/properties/$metadata/properties/Created",                        "type": "string"                  },                  "CreatedBy": {                        "id": "/items/properties/$metadata/properties/CreatedBy",                        "type": "string"                  },                  "Modified": {                        "id": "/items/properties/$metadata/properties/Modified",                        "type": "string"                  },                  "ModifiedBy": {                        "id": "/items/properties/$metadata/properties/ModifiedBy",                        "type": "string"                  }                },                "type": "object"            },            "AssemblyResourceId": {                "id": "/items/properties/AssemblyResourceId",                "type": "null"            },            "ClassName": {                "id": "/items/properties/ClassName",                "type": "null"            },            "DataSetIds": {                "id": "/items/properties/DataSetIds",                "type": "null"            },            "Description": {                "id": "/items/properties/Description",                "type": "string"            },            "ImageIds": {                "id": "/items/properties/ImageIds",                "type": "null"            },            "IsCpl": {                "id": "/items/properties/IsCpl",                "type": "boolean"            },            "IsMaster": {                "id": "/items/properties/IsMaster",                "type": "boolean"            },            "IsParametrized": {                "id": "/items/properties/IsParametrized",                "type": "boolean"            },            "IsSubreport": {                "id": "/items/properties/IsSubreport",                "type": "boolean"            },            "MasterReportId": {                "id": "/items/properties/MasterReportId",                "type": "null"            },            "ModelId": {                "id": "/items/properties/ModelId",                "type": "string"            },            "ModelVersion": {                "id": "/items/properties/ModelVersion",                "type": "integer"            },            "Name": {                "id": "/items/properties/Name",                "type": "string"            },            "Orientation": {                "id": "/items/properties/Orientation",                "type": "string"            },            "Resources": {                "id": "/items/properties/Resources",                "type": "null"            },            "StyleSheetId": {                "id": "/items/properties/StyleSheetId",                "type": "null"            },            "SubreportIds": {                "id": "/items/properties/SubreportIds",                "type": "null"            },            "Tags": {                "id": "/items/properties/Tags",                "items": {                  "id": "/items/properties/Tags/items",                  "type": "string"                },                "type": "array"            },            "ThemeId": {                "id": "/items/properties/ThemeId",                "type": "string"            },            "Type": {                "id": "/items/properties/Type",                "type": "string"            },            "_id": {                "id": "/items/properties/_id",                "type": "string"            },            "_version": {                "id": "/items/properties/_version",                "type": "integer"            }      },      "type": "object"    },    "type": "array"}




页: [1]
查看完整版本: ActiveReport15 JSON 提供程序如何访问授权REST API