找回密码
 立即注册

QQ登录

只需一步,快速开始

@.@

注册会员

2

主题

6

帖子

22

积分

注册会员

积分
22
最新发帖
@.@
注册会员   /  发表于:2020-7-30 16:25  /   查看:3442  /  回复:3
本帖最后由 @.@ 于 2020-7-30 18:08 编辑

工具栏中已经增加了自定义按钮,想请问:
1.按照文档中写的导出功能,点击后没有反应
2.怎么添加鼠标悬浮在按钮上的提示文字


=============编辑后=================

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

3 个回复

倒序浏览
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2020-7-30 17:44:03
沙发
你好,关于导出按钮的 添加,你可以看看这个具体的写法:
  1. <script>
  2.         function load() {
  3.             viewer = new ActiveReports.Viewer('#root', { language: 'zh' });                                 
  4.             var svgExcelLogo = atob('PHN2ZyB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iIHhtbG5zOmNjPSJodHRwOi8vY3JlYXRpdmVjb21tb25zLm9yZy9ucyMiIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyIgeG1sbnM6c3ZnPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczpzb2RpcG9kaT0iaHR0cDovL3NvZGlwb2RpLnNvdXJjZWZvcmdlLm5ldC9EVEQvc29kaXBvZGktMC5kdGQiIHhtbG5zOmlua3NjYXBlPSJodHRwOi8vd3d3Lmlua3NjYXBlLm9yZy9uYW1lc3BhY2VzL2lua3NjYXBlIiB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCA4OC4wMzAwNjYgODYiIHZlcnNpb249IjEuMSIgaWQ9InN2ZzIiIGlua3NjYXBlOnZlcnNpb249IjAuNDguMy4xIHI5ODg2IiBzb2RpcG9kaTpkb2N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SwyMnYxaC01di03aDF2NkgyOUwyOSwyMnogTTE0LDE3djZoMXYtNiBoMnYtMWgtNXYxSDE0TDE0LDE3eiBNMTAsMTl2LTNoMXY3aC0xdi0zSDd2M0g2di03aDF2M0gxMEwxMCwxOXogTTIwLjUsMTlMMTksMTZoLTAuNUgxOHY3aDF2LTVsMSwyaDAuNUgyMWwxLTJ2NWgxdi03aC0wLjVIMjIgTDIwLjUsMTlMMjAuNSwxOXoiLz48L2c+PC9nPjwvc3ZnPg==');    //pdfExportButton using iconCssClass
  6.             //pdfExportButton using iconCssClass
  7.             pdfExportButton = {
  8.                 key: 'pdfExternalExportButton',
  9.                 iconCssClass: 'mdi mdi-file',
  10.                 text: "PDF Export",
  11.                 title: "PDF Export",
  12.                 checked: true,
  13.                 enabled: true,
  14.                 action: function (item) {
  15.                     var settings = { title: 'Invoice List', userPassword: 'user_Pwd' };
  16.                     var cancelCallback = function () {
  17.                         return false;
  18.                     }
  19.                     viewer.export('pdf', settings, { cancel: cancelCallback })
  20.                         .then(result => result.download("Exported_PDF"));
  21.                 }
  22.             };
  23.             //xlsxExportButton using svg icon
  24.             xlsxExportButton = {
  25.                 key: 'xlsxExternalExportButton',
  26.                 icon: { type: 'svg', content: svgExcelLogo },
  27.                 title: "Excel Export",
  28.                 checked: true,
  29.                 enabled: true,
  30.                 action: function (item) {
  31.                     var settings = { creator: 'Jack', password: 'Pwd' };
  32.                     var cancelCallback = function () {
  33.                         return false;
  34.                     }
  35.                     viewer.export('xlsx', settings, { cancel: cancelCallback })
  36.                         .then(result => result.download("Exported_XLSX"));
  37.                 }
  38.             };
  39.             //htmlExportButton using svg icon
  40.             htmlExportButton = {
  41.                 key: 'htmlExternalExportButton',
  42.                 icon: { type: 'svg', content: svgHTMLLogo },
  43.                 title: "HTML Export",
  44.                 checked: true,
  45.                 enabled: true,
  46.                 action: function (item) {
  47.                     var settings = { autoPrint: 'true' };
  48.                     var cancelCallback = function () {
  49.                         return false;
  50.                     }
  51.                     viewer.export('html', settings, { cancel: cancelCallback })
  52.                         .then(result => result.download("Exported_HTML"));
  53.                 }
  54.             };                     
  55.             viewer.toolbar.addItem(pdfExportButton);
  56.             viewer.toolbar.addItem(xlsxExportButton);
  57.             viewer.toolbar.addItem(htmlExportButton);
  58.             //调整工具栏的按钮的显示顺序和显示的按钮,可以根据自己的需求进行工具栏的调整。
  59.            viewer.toolbar.updateLayout({
  60.                 default: ['xlsxExternalExportButton', '$navigation', '$history', '$fullscreen', '$split', '$print', '$refresh', '$galleymode', '$mousemode', '$split', '$continuousmode', '$singlepagemode', '$zoom', 'htmlExternalExportButton', 'pdfExternalExportButton', '$split'],               
  61.             });
  62.             viewer.registerFont("fonts/fontsConfig.json").then(function () { viewer.open("Quotation.rdlx-json") });

  63.          
  64.         }
  65.     </script>
复制代码


回复 使用道具 举报
@.@
注册会员   /  发表于:2020-7-30 18:08:08
板凳
KearneyKang 发表于 2020-7-30 17:44
你好,关于导出按钮的 添加,你可以看看这个具体的写法:

非常感谢,按钮的悬浮提示已经解决了,不过我按照您的写法写了导出还是实现不了,麻烦您再看一下我的代码,我修改在原帖中了
回复 使用道具 举报
KearneyKang讲师达人认证 悬赏达人认证
超级版主   /  发表于:2020-7-30 18:32:05
地板
你好,这个你给的截图,看起来没有问题,但是估计写法那有一点不对,比如符号什么的,你把我提供的代码直接放到你的页面去试试,因为这是我在我本地试了是可以正常导出来的。你好好试试
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部