Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/331.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在打印telerik报告时在打开的保存对话框中添加打印_C#_Web_Telerik Reporting - Fatal编程技术网

C# 如何在打印telerik报告时在打开的保存对话框中添加打印

C# 如何在打印telerik报告时在打开的保存对话框中添加打印,c#,web,telerik-reporting,C#,Web,Telerik Reporting,我用的是Telerik Report。我想在呈现此报告时将“打印”选项添加到对话框中 是否有任何方法可以将打印选项添加到对话框中 { Telerik.Reporting.Processing.ReportProcessor reportProcessor = new Telerik.Reporting.Processing.ReportProcessor(); DTSReport DTSRpt = new DTSReport();

我用的是Telerik Report。我想在呈现此报告时将“打印”选项添加到对话框中

是否有任何方法可以将打印选项添加到对话框中

    {
        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;
    }

对于网页,您可以使用javascript显示打印对话框,带有
window.print()



您还可以添加对
onload
事件的调用,或者如果您有任何其他特定场景,可以使用jquery绑定它。

这是web还是桌面?它是web应用程序。。
<input type="button" value="Print!" onClick="window.print()">