开发者

Report Viewer printing?

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?


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.


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();
    });
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜