打印机的连接问题

secret_xing 2005-08-08 03:37:35

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);
在客户端设置的时候,打印机的名称总是设置失败,请教解决方法,谢谢!
...全文
83 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
jtl510 2005-08-18
  • 打赏
  • 举报
回复
oRpt.PrintToPrinter(1,false,0,0);
改为
oRpt.PrintToPrinter(1,true,0,0);

4,820

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 图表区
社区管理员
  • 图表区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧