2015-06-02 133 views
0

我正在使用Telerik Report。在渲染此报告时,我想将打印选项添加到对话框中。如何在打印telerik报告时打开打开保存对话框

有什么办法可以在对话框中添加打印选项。

{ 
     Telerik.Reporting.Processing.ReportProcessor reportProcessor = 
      new Telerik.Reporting.Processing.ReportProcessor(); 
     DTSReport DTSRpt = new DTSReport(); 
     DTSRpt.ReportParameters["PendingId"].Value = id; 
     InstanceReportSource reportSource = new InstanceReportSource(); 
     reportSource.ReportDocument = DTSRpt; 
     RenderingResult renderingResult = 
      reportProcessor.RenderReport("PDF", reportSource, null); 
     MemoryStream ms = new MemoryStream(); 
     ms.Write(renderingResult.DocumentBytes, 0, renderingResult.DocumentBytes.Length); 
     ms.Flush(); 

     FileContentResult result = new FileContentResult(ms.GetBuffer(), renderingResult.MimeType); 
     result.FileDownloadName = String.Format("DTS-{0}.pdf", id); 

     return result; 
    } 
+0

是这个网页或桌面? – pollirrata

+0

这是一个网络应用程序.. – bala

回答

0

对于网页,你可以使用JavaScript来显示打印对话框,用window.print()

<input type="button" value="Print!" onClick="window.print()"> 

您也可以将呼叫添加到onload事件,或使用jQuery,如果您有任何绑定它其他具体情况。

相关问题