找回密码
 立即注册

QQ登录

只需一步,快速开始

UUZ

注册会员

4

主题

9

帖子

61

积分

注册会员

积分
61
  • 195

    金币

  • 4

    主题

  • 9

    帖子

最新发帖
UUZ
注册会员   /  发表于:2024-1-19 09:07  /   查看:1224  /  回复:5
1金币
开启画廊模式的语句是

viewer.renderMode = "Galley";
那关闭画廊模式的语句怎么写,现在想用代码控制关闭画廊模式并切换到连续模式

最佳答案

查看完整内容

您可以使用我们的针对模式切换的接口实现。实现代码参考如下: 参考文档:https://demo.grapecity.com.cn/activereportsjs/api/classes/ReportViewer.Viewer

5 个回复

倒序浏览
最佳答案
最佳答案
Felix.LiWyn认证
超级版主   /  发表于:2024-1-19 09:07:44
来自 4#
您可以使用我们的针对模式切换的接口实现。实现代码参考如下:

  1. var viewer = new ActiveReports.Viewer("#viewer-host");
  2.   var Galley = {
  3.     key: '$Galley',
  4.     enabled: true,
  5.     text: "Galley",
  6.     action: function(item) {
  7.       console.log(viewer)
  8.       viewer.renderMode = "Galley";
  9.       viewer.open("./report/测试.rdlx-json")
  10.     },
  11.   };
  12.   viewer.toolbar.addItem(Galley);
  13.   var continuous = {
  14.     key: '$continuous',
  15.     enabled: true,
  16.     text: "continuous",
  17.     action: function(item) {
  18.       viewer.renderMode = "Paginated";
  19.       viewer.viewMode = 1;
  20.       console.log(viewer)
  21.       viewer.open("./report/测试.rdlx-json")
  22.     },
  23.   };
  24.   viewer.toolbar.addItem(continuous);

  25.   viewer.open("./report/测试.rdlx-json")
复制代码
参考文档:https://demo.grapecity.com.cn/ac ... ReportViewer.Viewer
回复 使用道具 举报
Bella.YuanWyn认证
超级版主   /  发表于:2024-1-19 10:09:27
2#
您好,这句话注释掉就相当于关闭画廊模式,或者使用其他模式预览也相当于关闭画廊模式。
连续模式:viewer.viewMode = "Continuous";

连续模式参考地址:
https://demo.grapecity.com.cn/activereportsjs/demos/api/Continuous/purejs
回复 使用道具 举报
UUZ
注册会员   /  发表于:2024-1-19 10:18:37
3#
本帖最后由 UUZ 于 2024-1-19 10:31 编辑
Bella.Yuan 发表于 2024-1-19 10:09
您好,这句话注释掉就相当于关闭画廊模式,或者使用其他模式预览也相当于关闭画廊模式。

连续模式参考地 ...

我们写了两个自定义按钮 第一个按钮中有viewer.renderMode = "Galley";这个逻辑,
现在问题是在第二个按钮中直接用viewer.viewMode = "Continuous";是不生效的,还处于画廊模式   
我的需求是点了第一个按钮后,再点第二个按钮能进入连续模式

回复 使用道具 举报
UUZ
注册会员   /  发表于:2024-1-19 17:20:51
5#
Felix.Li 发表于 2024-1-19 09:07
您可以使用我们的针对模式切换的接口实现。实现代码参考如下:

参考文档:https://demo.grapecity.com.cn/ ...

可以了 谢谢
回复 使用道具 举报
Eden.SunWyn认证
超级版主   /  发表于:2024-1-19 18:32:46
6#

不客气的,有新的问题,您再开新帖解决。
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 立即注册
返回顶部