lenkaguo

在页面中加载报表时,当报表纸张的高度和宽度大于浏览器的高度和宽度时,就会自动生成滚动条,以便报表加载完全,但很多时候报表浏览器滚动条的出现,可能会导致一个页面有多个滚动条的重叠出现,用户体验非常不好,所以如果能够禁用掉滚动条,UI 就更能美观一些。

了解了滚动条出现的原理后,就能针对核心来提出解决方案,去掉滚动条的方法就是将报表div的高度和宽度设置比报表纸张大,那么滚动条就不会显示了。不过这种行为还是危险的,建议大家避免执行这种操作。

操作步骤:

1. 添加报表模板

设置纸张尺寸

image

2. 新建Web项目,添加div,设置Width和Height属性的单位为Cm;

保证div的宽度和高度比报表纸张大。

<div id="viewerContainer" style="width:27cm;float:none; height:40cm;border:1px solid gray;margin-top:20px"></div>

 

3. 初始化html5viewer

  $(function () {
             var reportid = "Reports/RdlReport1.rdlx";
             var temp;

            var viewer = GrapeCity.ActiveReports.Viewer
                ({
                element: \'#viewerContainer\',
                reportService: {
                    url: \'ActiveReports.ReportService.asmx\'
                },
                report: {
                    id: "Reports/RdlReport2.rdlx",
                    parameters: [{
                        name: \'ReportParameter1\',
                        value: [1, 2, 3, 4],
                    }]
                },
                uiType: \'desktop\',
                localeUri: \'Scripts/Localeuri.txt\',                   
                error: function (error) {
                    console.log("error");
                }
                });

            var reportLoaded = function reportLoaded(reportInfo) {
                console.log(reportInfo.parameters);

            }

 

分类:

技术点:

相关文章:

  • 2021-11-29
  • 2021-12-04
  • 2021-04-25
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
  • 2021-12-04
  • 2021-11-29
猜你喜欢
  • 2021-11-29
  • 2021-12-25
  • 2021-12-04
  • 2021-10-17
  • 2021-12-04
  • 2021-12-04
相关资源
相似解决方案