【问题标题】:How to add Print on open save dialogue box while printing telerik reports如何在打印 Telerik 报告时在打开保存对话框中添加打印
【发布时间】:2015-06-02 13:46:35
【问题描述】:

我正在使用 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;
    }

【问题讨论】:

  • 这是网页还是桌面?
  • 这是一个网络应用程序..

标签: c# web telerik-reporting


【解决方案1】:

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

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

您也可以将调用添加到onload事件,如果您有任何其他特定场景,也可以使用jquery进行绑定。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多