| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 921 人关注过本帖
标题:两台打印机同时打印
只看楼主 加入收藏
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
结帖率:56.25%
收藏
已结贴  问题点数:20 回复次数:9 
两台打印机同时打印
请问,如何用程序设置一份表,两台打印机同时打印出来?一台是本地打印机,另一台是网络打印机。
搜索更多相关主题的帖子: 打印机 如何 网络 
2015-05-20 22:46
吹水佬
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:版主
威 望:451
帖 子:10607
专家分:43182
注 册:2014-5-20
收藏
得分:4 
参考:
SET PRINTER TO [DEFAULT | NAME WindowsPrinterName]
SET PRINTER TO NAME \\ ServerName\ PrinterName

打印时两者之间切换可以吗?
报表设计时不要选“保存打印机环境”
2015-05-20 22:52
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11857
专家分:43421
注 册:2006-5-13
收藏
得分:4 
两台同时打印?类似复印效果?

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2015-05-20 22:54
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 2楼 吹水佬
请问,“SET DEVICE TO PRINTER”这句是什么意思?
2015-05-20 23:20
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
请大家帮忙看看怎样设置?现在程序是本地打印,怎样才能加入网络一起打印。

DEFINE CLASS printform AS Form
 TOP = 250
 LEFT = 150
 HEIGHT = 110
 WIDTH = 330
 BORDERSTYLE = 2
 CAPTION = '打印窗口'
 CLOSABLE = .F.
 CONTROLBOX = .T.
 MAXBUTTON = .F.
 MINBUTTON = .F.
 MOVABLE = .F.
 VISIBLE = .T.
 BACKCOLOR = RGB(255,255,255)
 NAME = 'printform'
 ADD OBJECT PRINTLABEL AS LABEL WITH TOP = 20 , LEFT = 20 , FONTSIZE = 16 , AUTOSIZE  ;
      = .T. , FONTITALIC = .T. , CAPTION = '打印窗口欢迎您!' , BACKCOLOR =  ;
      RGB(192,192,192) , FORECOLOR = RGB(255,0,0) , NAME = 'printlabel'
 ADD OBJECT PRINTSTAR AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '开始打印' , HEIGHT = 25 , TOP = 70 , LEFT = 70 , WIDTH = 80 ,  ;
      VISIBLE = .T. , NAME = 'printstar'
 ADD OBJECT PRINTCANC AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '取消打印' , HEIGHT = 25 , TOP = 70 , LEFT = 170 , WIDTH = 80 ,  ;
      VISIBLE = .T. , NAME = 'printcanc'
 ADD OBJECT PRINTFINISH AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '完 成' , HEIGHT = 25 , TOP = 70 , LEFT = 80 , WIDTH = 50 ,  ;
      VISIBLE = .F. , NAME = 'printfinish'
 ADD OBJECT PRINTFAIL AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '失 败' , HEIGHT = 25 , TOP = 70 , LEFT = 180 , WIDTH = 50 ,  ;
      VISIBLE = .F. , NAME = 'printfail'

PROCEDURE printstar.Click
 IF SYS(13) = 'OFFLINE'
    ?? CHR(7)
    THISFORM.PRINTLABEL.CAPTION = '打印机没有准备好! 请检查.'
    RETURN
 ENDIF
 SET DEVICE TO PRINTER
 SET PRINTER FONT '宋体' , 12.3
 @ 4.900 , 10 SAY LYSARY(1,1)
 ENDIF
 @ 18.500 , 82 SAY CZY
 SET PRINTER TO
 SET DEVICE TO SCREEN
 THISFORM.PRINTLABEL.CAPTION = '打印完成?'
 THISFORM.PRINTSTAR.VISIBLE = .F.
 THISFORM.PRINTCANC.VISIBLE = .F.
 THISFORM.PRINTFINISH.VISIBLE = .T.
 THISFORM.PRINTFAIL.VISIBLE = .T.
ENDPROC
*------

PROCEDURE printcanc.Click
  CKFORMSET.PRINTFORM.HIDE
 CKFORMSET.CKFORM.ALWAYSONTOP = .T.
 CKFORMSET.CKFORM.ENABLED = .T.
 CKFORMSET.CKFORM.FINISH.ENABLED = .F.
 CKFORMSET.CKFORM.CKXG.ENABLED = .F.
 CKFORMSET.CKFORM.BYFXG.ENABLED = .F.
 CKFORMSET.CKFORM.CKFORMCLS.ENABLED = .T.
  CKFORMSET::INIT
  CKFORMSET.CKFORM.REFRESH
 CKFORMSET.CKFORM.HZHTEXTBOX.DISABLEDBACKCOLOR = RGB(192,192,192)
 CKFORMSET.CKFORM.HZMCTEXTBOX.DISABLEDBACKCOLOR = RGB(192,192,192)
 CKFORMSET.CKFORM.KCJS1.DISABLEDFORECOLOR = RGB(255,255,255)
 CKFORMSET.CKFORM.KCBS1.DISABLEDFORECOLOR = RGB(255,255,255)
 = OBJECTSET(1,255,.T.)
 = OBJECTSET(2,192,.F.)
 = OBJECTSET(3,192,.F.)
 = OBJECTSET(4,192,.F.)
 = BYF(1)
  CKFORMSET.CKFORM.SPPH1.SETFOCUS
ENDPROC
*------

PROCEDURE printfinish.Click
 THISFORM.PRINTSTAR.VISIBLE = .T.
 THISFORM.PRINTCANC.VISIBLE = .T.
 THISFORM.PRINTFINISH.VISIBLE = .F.
 THISFORM.PRINTFAIL.VISIBLE = .F.
  PRINTFORM.PRINTCANC::CLICK
ENDPROC
*------

PROCEDURE printfail.Click
 THISFORM.PRINTSTAR.VISIBLE = .T.
 THISFORM.PRINTCANC.VISIBLE = .T.
 THISFORM.PRINTFINISH.VISIBLE = .F.
 THISFORM.PRINTFAIL.VISIBLE = .F.
 THISFORM.PRINTLABEL.CAPTION = '打印窗口欢迎您!'
ENDPROC

[ 本帖最后由 pylyh 于 2015-5-20 23:27 编辑 ]
2015-05-20 23:25
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 3楼 hu9jj
是的,只要同时打印就行了。
2015-05-20 23:32
tlliqi
Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19Rank: 19
等 级:贵宾
威 望:204
帖 子:15453
专家分:65956
注 册:2006-4-27
收藏
得分:4 
以下是引用pylyh在2015-5-20 23:25:46的发言:

请大家帮忙看看怎样设置?现在程序是本地打印,怎样才能加入网络一起打印。
 
DEFINE CLASS printform AS Form
 TOP = 250
 LEFT = 150
 HEIGHT = 110
 WIDTH = 330
 BORDERSTYLE = 2
 CAPTION = '打印窗口'
 CLOSABLE = .F.
 CONTROLBOX = .T.
 MAXBUTTON = .F.
 MINBUTTON = .F.
 MOVABLE = .F.
 VISIBLE = .T.
 BACKCOLOR = RGB(255,255,255)
 NAME = 'printform'
 ADD OBJECT PRINTLABEL AS LABEL WITH TOP = 20 , LEFT = 20 , FONTSIZE = 16 , AUTOSIZE  ;
      = .T. , FONTITALIC = .T. , CAPTION = '打印窗口欢迎您!' , BACKCOLOR =  ;
      RGB(192,192,192) , FORECOLOR = RGB(255,0,0) , NAME = 'printlabel'
 ADD OBJECT PRINTSTAR AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '开始打印' , HEIGHT = 25 , TOP = 70 , LEFT = 70 , WIDTH = 80 ,  ;
      VISIBLE = .T. , NAME = 'printstar'
 ADD OBJECT PRINTCANC AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '取消打印' , HEIGHT = 25 , TOP = 70 , LEFT = 170 , WIDTH = 80 ,  ;
      VISIBLE = .T. , NAME = 'printcanc'
 ADD OBJECT PRINTFINISH AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '完 成' , HEIGHT = 25 , TOP = 70 , LEFT = 80 , WIDTH = 50 ,  ;
      VISIBLE = .F. , NAME = 'printfinish'
 ADD OBJECT PRINTFAIL AS COMMANDBUTTON WITH FONTSIZE = 11 , FONTNAME = '宋体' ,  ;
      CAPTION = '失 败' , HEIGHT = 25 , TOP = 70 , LEFT = 180 , WIDTH = 50 ,  ;
      VISIBLE = .F. , NAME = 'printfail'
 
PROCEDURE printstar.Click
 IF SYS(13) = 'OFFLINE'
    ?? CHR(7)
    THISFORM.PRINTLABEL.CAPTION = '打印机没有准备好! 请检查.'
    RETURN  
 ENDIF  
 SET DEVICE TO PRINTER
 SET PRINTER FONT '宋体' , 12.3
 @ 4.900 , 10 SAY LYSARY(1,1)
 ENDIF  
 @ 18.500 , 82 SAY CZY
 SET PRINTER TO
 SET DEVICE TO SCREEN
 THISFORM.PRINTLABEL.CAPTION = '打印完成?'
 THISFORM.PRINTSTAR.VISIBLE = .F.
 THISFORM.PRINTCANC.VISIBLE = .F.
 THISFORM.PRINTFINISH.VISIBLE = .T.
 THISFORM.PRINTFAIL.VISIBLE = .T.
ENDPROC
*------  
 
PROCEDURE printcanc.Click
  CKFORMSET.PRINTFORM.HIDE
 CKFORMSET.CKFORM.ALWAYSONTOP = .T.
 CKFORMSET.CKFORM.ENABLED = .T.
 CKFORMSET.CKFORM.FINISH.ENABLED = .F.
 CKFORMSET.CKFORM.CKXG.ENABLED = .F.
 CKFORMSET.CKFORM.BYFXG.ENABLED = .F.
 CKFORMSET.CKFORM.CKFORMCLS.ENABLED = .T.
  CKFORMSET::INIT
  CKFORMSET.CKFORM.REFRESH
 CKFORMSET.CKFORM.HZHTEXTBOX.DISABLEDBACKCOLOR = RGB(192,192,192)
 CKFORMSET.CKFORM.HZMCTEXTBOX.DISABLEDBACKCOLOR = RGB(192,192,192)
 CKFORMSET.CKFORM.KCJS1.DISABLEDFORECOLOR = RGB(255,255,255)
 CKFORMSET.CKFORM.KCBS1.DISABLEDFORECOLOR = RGB(255,255,255)
 = OBJECTSET(1,255,.T.)
 = OBJECTSET(2,192,.F.)
 = OBJECTSET(3,192,.F.)
 = OBJECTSET(4,192,.F.)
 = BYF(1)
  CKFORMSET.CKFORM.SPPH1.SETFOCUS
ENDPROC
*------  
 
PROCEDURE printfinish.Click
 THISFORM.PRINTSTAR.VISIBLE = .T.
 THISFORM.PRINTCANC.VISIBLE = .T.
 THISFORM.PRINTFINISH.VISIBLE = .F.
 THISFORM.PRINTFAIL.VISIBLE = .F.
  PRINTFORM.PRINTCANC::CLICK
ENDPROC
*------  
 
PROCEDURE printfail.Click
 THISFORM.PRINTSTAR.VISIBLE = .T.
 THISFORM.PRINTCANC.VISIBLE = .T.
 THISFORM.PRINTFINISH.VISIBLE = .F.
 THISFORM.PRINTFAIL.VISIBLE = .F.
 THISFORM.PRINTLABEL.CAPTION = '打印窗口欢迎您!'
ENDPROC
还没见过这样的打印程式,需要这样罗琐?
2015-05-21 01:52
wangzhiyi
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:34
帖 子:366
专家分:684
注 册:2014-4-9
收藏
得分:4 
打印专家呀,解决一个打印问题写出这么长的代码。佩服。
2015-05-21 08:35
TonyDeng
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
等 级:贵宾
威 望:304
帖 子:25859
专家分:48889
注 册:2011-6-22
收藏
得分:4 
PROCEDURE printstar.Click
IF SYS(13) = 'OFFLINE'
    ?? CHR(7)
    THISFORM.PRINTLABEL.CAPTION = '打印机没有准备好! 请检查.'
    RETURN
ENDIF
SET DEVICE TO PRINTER
SET PRINTER FONT '宋体' , 12.3
@ 4.900 , 10 SAY LYSARY(1,1)
ENDIF
@ 18.500 , 82 SAY CZY
SET PRINTER TO
SET DEVICE TO SCREEN

THISFORM.PRINTLABEL.CAPTION = '打印完成?'
THISFORM.PRINTSTAR.VISIBLE = .F.
THISFORM.PRINTCANC.VISIBLE = .F.
THISFORM.PRINTFINISH.VISIBLE = .T.
THISFORM.PRINTFAIL.VISIBLE = .T.
ENDPROC
*------

你能寫得出紅色的那些代碼,難道就不知道printer是可以重定向的?

授人以渔,不授人以鱼。
2015-05-21 10:58
pylyh
Rank: 1
等 级:新手上路
帖 子:59
专家分:0
注 册:2013-8-26
收藏
得分:0 
回复 9楼 TonyDeng
请问怎样重定向?
2015-05-30 15:11
快速回复:两台打印机同时打印
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.030388 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved