本文介绍了打印时RPC服务器不可用。打印机安装在网络系统上。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 嗨 我试图从按钮点击打印报告(.rdlc),如下所示。它会抛出与报表查看器控件相同的消息。 private void btnPrint_Click( object sender,EventArgs e) { Report1。 PrintOptions.PrinterName = cmbPrinters.Text; Report1.PrintOptions.PaperSize =(CrystalDecisions.Shared.PaperSize)GetPaperSize(cmbPrinters.Text, A4); // PaperSize.PaperA4 - PaperA4 Report1 .PrintOptions.PaperOrientation = PaperOrientation.Landscape; Report1.PrintToPrinter( 1 , false , 1 , 1 ); MessageBox.Show(& quot; Print Done& quot;); } 说到这一行: Report1.PrintToPrinter ( 1 , false , 1 , 1 ); 抛出异常说 RPC服务器不可用。打印机工作正常。它是一个网络打印机,我给它提供了正确的路径。 需要注意的是,当我第一次尝试打印它时抛出异常说RPC服务器不可用之后。请帮忙。 谢谢 代码块更正 解决方案 这里有很多可能的建议 [ ^ ]。 hi I am trying to print a report (.rdlc) from button click as below. It throws a message as same as from a report viewer control.private void btnPrint_Click(object sender, EventArgs e){ Report1.PrintOptions.PrinterName = cmbPrinters.Text; Report1.PrintOptions.PaperSize = (CrystalDecisions.Shared.PaperSize)GetPaperSize(cmbPrinters.Text, "A4"); //PaperSize.PaperA4 - It goes PaperA4 Report1.PrintOptions.PaperOrientation = PaperOrientation.Landscape; Report1.PrintToPrinter(1, false, 1, 1); MessageBox.Show("Print Done");}when it comes to the line : Report1.PrintToPrinter(1, false, 1, 1);it throws exception saying "The RPC server is unavailable". The printer is working fine. Its a network printer and I have given proper path for it.The point to be noted is, when for the first time I tried to print it threw exception saying "The RPC server is unavailable" there after. Please help.Thankscode block corrected 解决方案 Lots of possible suggestions here[^]. 这篇关于打印时RPC服务器不可用。打印机安装在网络系统上。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 09-09 06:02