[{"id":"bcb0874d-299b-448e-9552-9e9b25ef80dd","tags":[{"product":null,"links":null,"id":"ba7e818e-4f6b-4211-b1ac-58e3bafcf439","name":"\u66F4\u65B0","color":"orange","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8ce3627e-9e58-471b-9133-4f135d191e7b","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"ae60ae59-34f5-4f32-a8eb-243ed1457543","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"3d4848c3-910f-4ffa-9153-60bb507334a9","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"133f4ca6-d951-4d65-a618-3dc6301266f7","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"de62ec1c-813e-40b1-8160-a4cd109afe64","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2426c71d-8332-4cbd-a436-1ec4f8666464","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2ce7b6b0-78aa-4e4b-bf8a-e4ba2f988298","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"4706db46-0811-4652-8f59-1e0a1da84758","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"8f1271bb-2cd9-4f39-9897-c15b239ee7ab","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"677e13a7-6f3e-449f-986c-2c3a26f8d54f","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"5e40f6dc-caec-49d7-a1d0-be65f06815ba","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"2457f0e0-9e71-4860-a87d-065e0fb84f84","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"d5c67fd0-1145-482c-9113-97b492c44c18","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"a609a8fa-ab91-4c1d-a1c3-d209d0463303","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]},{"id":"b4a9eb15-94e5-48df-b218-a24138f0cf9c","tags":[{"product":null,"links":null,"id":"adf72f47-7f61-4239-8392-b9bcc127fa80","name":"\u65B0\u589E","color":"green","productId":"0995490e-43fc-4d6e-bc8d-8e66f38b0c63"}]}]
        
(Showing Draft Content)

集成时定义报表设计器

功能概述

Wyn 支持用户自定义集成报表设计器并且开放接口满足用户个性化定制化系统风格调整,同时支持通过API去动态创建报表,控制报表设计器相关功能组件,完全融入第三方业务系统,提高用户体验和工作效率。

自定义设计器主要是通过参数来完成,本节内容为您举几个典型的示例。其他更多接口的介绍,请您参见API文档。

自定义设计器关闭按钮事件

开发设计器关闭按钮事件,用户可自定义关闭按钮触发的事件,可以在关闭操作中进行更多的逻辑处理,例如页面跳转,关闭时进行是否保存提醒,也可以获取到当前设计器里面的内容进行逻辑判断等。

onClose: function() {
        // ... specify on-closing logic
        // ... destroy Designer
        // ... specify on-closed logic
},

193156rpiwpdytuwdeydcc

创建报表提供API接口

可以由用户动态控制创建空白 RDL 报表,创建空白页面报表,基于某个报表模板来创建一个新的报表,或者创建一些自定义的报表,例如创建报表时默认指定报表的数据集和参数等任意的自定义报表内容;方便集成时,根据业务需求动态创建任意的预设好一些信息的报表;

使用现有报表模板创建报表

ins.api.createReport({
        templateInfo: { id: 'your-template-id' },
}).then(function(result) {
        if (result.type === 'error') {
                console.error([result.errorCaption, ...result.errorDetails].join('\n'));
                return;
        }
        console.log('Report is created successfully.');
});

创建自定义内容的报表

ins.api.createReport({
        templateInfo: { content: { <your-custom-content> } },
}).then(function(result) {
        // ...
});

当前正在编辑的报表内容也可以通过设计器API获取。

const content = ins.api.getReportContent();

创建报表时添加共享数据集

ins.api.createReport({
        dataSets: [
                { id: 'your-server-data-set-id', name: 'your-server-data-set-name', version: 1 },
        ],
}).then(function(result) {
        // ...
});

动态控制数据绑定、属性设置以及工具箱

控制数据源、数据集、报表参数

dataTab: {
        dataSources: {
                visible: true,
                canModify: false,
        },
        dataSets: {
                visible: true,
                canModify: false,
        },
        parameters: {
                visible: true,
                canModify: false,
        },
        commonValues: { visible: false },
},

192347b9rrwgvgjvr9ogvr

控制属性设置中属性

filterProperties: function(descriptors, reportItem) {
        const filteredDescriptors = descriptors.filter(desc => {
                if (desc.valuePath === 'Style' || desc.valuePath.startsWith('Style.')) return false;
                if (reportItem.Type === 'textbox' && desc.valuePath === 'Value') return false;
                return true;
        });
        return filteredDescriptors.sort((d1, d2) => d1.category.localeCompare(d2.category));
},

192712vsstsrrss75r9d99

控制工具箱的组件顺序以及是否可用

调整设计器组件顺序

reportItems: 'Table,TextBox,Image,Shape',

控制设计器组件的可见性

reportExplorer: { visible: false },
groupEditor: { visible: false },
layersEditor: { visible: false },
toolBox: { visible: false },
parametersView: { visible: false },
aboutButton: { visible: false },
propertiesTab: {
        visible: false,
        // When mode is Basic/Advanced, Properties Mode button in Status Bar is hidden.
        mode: 'Basic',
},
dataTab: { visible: false },
infoTab: { visible: false },
// Hides only Grid Size editor in Snap Editor.
gridSize: { visible: false },
// Hides entire Snap Editor.
snapEditor: { visible: false },
showGrid: { visible: false },
showRulers: { visible: false },
zoomEditor: { visible: false },
// If units are specified explicitly, to in/cm, Units toggle in Status Bar is hidden.
units: 'in',

193044ox26s8hstshmh0oo

效果如下:

090948idndefut9ldc09ct