C# 如何在打印telerik报告时在打开的保存对话框中添加打印
我用的是Telerik Report。我想在呈现此报告时将“打印”选项添加到对话框中 是否有任何方法可以将打印选项添加到对话框中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.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()">