打印机的连接问题

secret_xing secret_xing 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区

ReportDocument oRpt = new ReportDocument();
TableLogOnInfo logOnInfo = new TableLogOnInfo ();
oRpt.Load("C:\\Inetpub\\wwwroot\\软件\\kb.rpt");
logOnInfo.ConnectionInfo.ServerName = Server.MachineName;
logOnInfo.ConnectionInfo.DatabaseName = Session["str_database"].ToString();
logOnInfo.ConnectionInfo.UserID = Session["str_id"].ToString();
logOnInfo.ConnectionInfo.Password = Session["str_pwd"].ToString();
oRpt.Database .Tables [0].ApplyLogOnInfo (logOnInfo);
CrystalReportViewer1.ReportSource = oRpt;
oRpt.SetDatabaseLogon(Session["str_id"].ToString(),Session["str_pwd"].ToString());
oRpt.PrintOptions.PrinterName=@"\\zhangyan\HPLaserJ"; //关键语句
oRpt.PrintToPrinter(1,false,0,0);
在客户端设置的时候,打印机的名称总是设置失败,请教解决方法,谢谢!
...全文
评论 1
收藏 已收藏
分享
返回顶部
secret_xing
图表区 4,818 成员 14,133 内容