Smartbi支持推送多种报表类型的消息到企业微信,包括电子表格、自助仪表盘、分析报告、Web链接、页面类型的资源。
1、在报表上右键选择“推送到企业号”。
2、填写企业应用、推送类型、推送给哪些成员、标题等信息,点击 推送(O) 按钮,将报表推送到企业微信。
设置项说明如下:
名称 | 说明 | |
---|---|---|
企业应用 | 部署企业微信扩展包创建的微信应用。 | |
推送类型 | 用于设置消息的推送方式,包括:
| |
推送给 | 部分成员 | 消息推送可以指定用户、部门、标签为推送对象。 |
全体成员 | 消息推送给全体成员,默认 。 | |
标题 | 推送消息的标题。 | |
描述 | 推送消息的描述。 | |
图片 | 推送消息的封面。 | |
链接地址 |
3、打开企业微信,打开企业应用”ldytest“发送的消息,可看到刚才推送的报表。
打开报表能够显示报表的详细信息:
Smartbi支持推送多种类型的消息到企业微信,包括文本消息、图片消息、语音消息、视频消息、文件消息、文本卡片消息、图文消息、mpnews图文消息以及markdown消息。
不支持模板卡片消息、模板卡片消息的按钮交互型、投票选择型和多项选择型消息类型。 |
1、在系统运维中,选择“企业微信工具箱”。
2、在ID获取中,根据需求选择对应的应用、用户、部门或标签。
3、在上传临时素材中,选择媒体类型、文件,点击 上传 按钮上传文件,媒体ID中自动会动获取ID。
4、点击 一键复制(D)按钮复制信息,将对应信息先复制到文本中。
5、根据注释将对应的信息替换到下列代码中,留下上传的消息类型代码,删除其余消息类型代码。
// appid var appid = "1000005"; // 发送人,可以选人或者部门 var receiver = JSON.stringify({ "user": "XiaoXi" }); // 文本类型的信息 var msg = JSON.stringify({ "msgType": "text", "msgContent": { "content": "测试发送信息" } }); // 发送图片类型的信息 msg = JSON.stringify({ "msgType": "image", "msgContent": { "media_id": "3snBPC9exFWCdtZwFGRoTNKnN1ffTLYyQwwvkeqDg9pIfm-ZGE7yW1nK5uIEOW1TY" } }); // 发送文本卡片 var msg = JSON.stringify({ "msgType": "textcard", "msgContent": { "title": "测试文本卡片", "description": "看一看demo站点上的这个电子表格", "url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", "btntxt": "打开报表" } }); // 发送markdown信息 var msg = JSON.stringify({ "msgType": "markdown", "msgContent": { "content": "#一级标题 \r\n##二级标题 \r\n**文字超链**:[简书](http://www.jianshu.com)" } }); // 发送图文消息 var msg = JSON.stringify({ "msgType": "news", "msgContent": { "articles":[ { "title": "新闻1", "description": "看一看demo站点上的这个电子表格", "url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", "picurl": "https://pic.ntimg.cn/20110811/8029346_082444436000_2.jpg" },{ "title": "新闻2", "description": "11123格", "url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", "picurl": "https://pic.quanjing.com/k6/67/QJ6278220913.jpg" },{ "title": "新闻2", "description": "3341212表格", "url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", "picurl": "https://pic.quanjing.com/32/3g/QJ6107931496.jpg" } ] } }); // 发送mpnews图文消息 var msg = JSON.stringify({ "msgType": "mpnews", "msgContent": { "articles":[ { "title": "新闻1", "thumb_media_id": "3snBPC9exFWCdtZwFGRoTNKnN1ffTLYyQwwvkeqDg9pIfm-ZGE7yW1nK5uIEOW1TY", "author": "系统用户1", "content": "<html><body><b>看一看demo站点上的这个电子表格</b></body></html>", "content_source_url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", },{ "title": "新闻2", "thumb_media_id": "3snBPC9exFWCdtZwFGRoTNKnN1ffTLYyQwwvkeqDg9pIfm-ZGE7yW1nK5uIEOW1TY", "author": "系统用户2", "content": "<html><body><b>看一看demo站点上的这个电子表格</b></body></html>", "content_source_url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", },{ "title": "新闻3", "thumb_media_id": "3snBPC9exFWCdtZwFGRoTNKnN1ffTLYyQwwvkeqDg9pIfm-ZGE7yW1nK5uIEOW1TY", "author": "系统用户3", "content": "<html><body><b>看一看demo站点上的这个电子表格</b></body></html>", "content_source_url": "https://demo.smartbi.com.cn/smartbi/vision/openresource.jsp?resid=I402881ba7c65508101487ca738e500a2&user=demo&password=demo", } ] } }); // 发送 connector.remoteInvoke("WeiXinModule", "sendAppMessage", [ appid, receiver, msg]); |
6、在计划任务的任务页中,点击 新建任务 按钮新建一个任务。
7、填写任务名称,并选择任务类型为“定制”,将刚才修改好的代码复制到自定义设置中,点击 保存 按钮。
8、点击 测试运行(T) 按钮,将消息发送到企业微信。
9、打开企业微信,打开企业应用”ldytest“发送的消息,可看到刚才推送的图片。