报告查看器打印?

发布于 2024-12-02 13:15:38 字数 265 浏览 2 评论 0原文

我的网络应用程序中显示了这份不错的报告。到目前为止一切顺利(尽管这是一个彻头彻尾的 PITA 到达这里)。

无论如何,我需要允许他们打印它。在设计模式下,我看到了小打印图标。运行时没有打印图标。

据我所知,似乎是控件的“本地模式”和“远程模式”之间的区别;但我并不是100%同意这一点。

我究竟如何告诉控件显示打印按钮?我确实看到了报告查看器的一个名为“ShowPrintButton”的属性,并且它绝对设置为 True。

有想法吗?

I have this nice report that shows up in my web app. So far so good (although it has been an utter PITA getting here).

Anyway, I need to allow them to print it. In design mode I see the little print icon. At runtime there is no print icon.

As near as I can tell it seems that it's a difference between "local mode" and "remote mode" for the control; but I'm not 100% on that.

How in the world do I tell the control to show the print button? I do see a property of the report viewer titled "ShowPrintButton" and it is most definitely set to True.

Ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦一生花开无言 2024-12-09 13:15:38

在服务器模式下,打印是通过 active x 插件完成的,因此打印只能在 IE 中使用,而不能在 Firefox 或其他浏览器中使用。正如您所提到的,打印按钮是通过打印按钮的可见性进行控制的,但仅在 IE 中或在 ssrs 配置中全局进行控制。
根据我的经验,最好的选择是鼓励用户导出为 PDF 并从那里打印。

In server mode printing is done via an active x plugin and as such printing is only available in IE and not Firefox or other browsers. The print button is controlled as you mentioned via the visibility of the print button but only in IE or globally in the ssrs configuration.
The best option in my experience is to encourage users to export to PDF and print from there.

孤单情人 2024-12-09 13:15:38

Chris,我们遇到了一个不同的问题(我记不清具体是什么),但我们最终不得不使用 Javascript 从客户端操作报表查看器。 看看这个。 和检查您是否看到可以帮助您的选项。

实际上,我只是注意到在一个使用报表查看器的 Web 应用程序上,打印按钮在除 Internet Explorer 之外的任何其他浏览器中都不可用;仅存在“导出”按钮。当您单击“导出”按钮时,它会提示您输入打印机。

下面是一些示例,展示了如何操作可用的导出格式:

  function resetExportOptions() {
        var exportlist = document.getElementById('report_viwer_id');
        if (exportlist != null) {
            exportlist.length = 0;
            var optn = document.createElement("OPTION");
            optn.value = "Select a format";
            optn.text = "Select a format";
            exportlist.options.add(optn);
            optn = document.createElement("OPTION");
            optn.value = "PDF";
            optn.text = "Acrobat (PDF) file";
            exportlist.options.add(optn);

            if ('-1' == 421) {
             var   optn2 = document.createElement("OPTION");
                optn2.value = "EXCEL";
                optn2.text = "Excel File";
                exportlist.options.add(optn2);
            }
        }
    }

    $(document).ready(function() {
        resetExportOptions();
    });

Chris, we had a different issue (I can't remember exactly what was it) but we ended up having to manipulate the reportviewer from the client-side using Javascript. Have a look at this. and check if you see an option there that can help you.

Actually, I just noticed on one web application that uses the report viewer, that the print button is not available IN ANY OTHER BROWSER different than Internet Explorer; only the "Export" button is present. When you click on the "Export" button it prompts you for the printer.

And here's some sample showing how to manipulate the Export formats available:

  function resetExportOptions() {
        var exportlist = document.getElementById('report_viwer_id');
        if (exportlist != null) {
            exportlist.length = 0;
            var optn = document.createElement("OPTION");
            optn.value = "Select a format";
            optn.text = "Select a format";
            exportlist.options.add(optn);
            optn = document.createElement("OPTION");
            optn.value = "PDF";
            optn.text = "Acrobat (PDF) file";
            exportlist.options.add(optn);

            if ('-1' == 421) {
             var   optn2 = document.createElement("OPTION");
                optn2.value = "EXCEL";
                optn2.text = "Excel File";
                exportlist.options.add(optn2);
            }
        }
    }

    $(document).ready(function() {
        resetExportOptions();
    });
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文