How to call print from asp.net on a reportviewer control?

后端 未结 1 1134
我寻月下人不归
我寻月下人不归 2021-01-14 17:09

I\'m using ssrs with an asp.net reportviewer control to display server reports. We want to do away with the toolbar because it doesn\'t fit with our look and feel but we wan

相关标签:
1条回答
  • 2021-01-14 17:18

    Here is a script to bring up the print dialog:

    <script language="javascript"> 
             function PrintReport() { 
                 var viewerReference = $find("ReportViewer1");
    
                 var stillonLoadState = clientViewer.get_isLoading();
    
                 if (!stillonLoadState ) { 
                     var reportArea = viewerReference .get_reportAreaContentType(); 
                     if (reportArea == Microsoft.Reporting.WebFormsClient.ReportAreaContent.ReportPage) { 
                         $find("ReportViewer1").invokePrintDialog(); 
                     } 
                 } 
             } 
         </script>
    

    To invoke, just call PrintReport()

    Detailed explanation here: http://blogs.msdn.com/b/selvar/archive/2011/04/09/invoking-the-print-dialog-for-report-viewer-2010-control-using-the-javascript-api.aspx

    0 讨论(0)
提交回复
热议问题