我在我们的应用程序中使用 Telerik 报告,并且主要通过以"应用程序模式"运行的 RDP 会话访问它。在本地一切正常,但是当我将其放在TS机器上时,它在打印对话框出现后冻结。
出现标准打印对话框,您可以选择打印机并点击确定,但随后打开一个小框,标题为打印...然后什么都不做。
我不确定要发布什么代码,因为它在本地很好,让我知道您想看到什么。 打印其他东西,如 Telerik 网格和图表也很好。
自己找到了答案。
我创建了一个标准的打印对话框屏幕并"滚动我自己的"打印方法,一切似乎都很好。希望这对其他人有所帮助。
private void reportViewer1_Print(object sender, CancelEventArgs e)
{
this.Cursor = Cursors.WaitCursor;
e.Cancel = true;
try
{
PrintDialog pd = new PrintDialog();
pd.PrinterSettings = new System.Drawing.Printing.PrinterSettings();
var result = pd.ShowDialog();
if (result ==DialogResult.OK)
{
// Print the report using the custom print controller
var reportProcessor
= new Telerik.Reporting.Processing.ReportProcessor();
reportProcessor.PrintReport(this.reportViewer1.ReportSource, pd.PrinterSettings);
}
}
catch (Exception ex)
{
Program.ExceptionHandler(ex);
}
this.Cursor = Cursors.Default;
}