找回密码
 立即注册

QQ登录

只需一步,快速开始

nicholas

初级会员

11

主题

50

帖子

335

积分

初级会员

积分
335

活字格认证

nicholas
初级会员   /  发表于:2014-7-16 09:59  /   查看:10348  /  回复:13
如何使打印程序按打印机驱动设置切纸:
比如:打印机驱动设置每打印10张切纸一次

For i = 1 To 100
                          
                            Currentbarcode = '12345678001'
                           
                            Try
                                Dim rpt1 As New AR33_13
                                rpt1.Restart()
                                rpt1.Run()
                                rpt1.Document.Print(False)
                                System.Threading.Thread.Sleep(currentprintsleep)
                            Catch ex As Exception
                                MessageBox.Show(ex.Message)
                            End Try
                           
                            Currentbarcode = (CLng(Currentbarcode + 1)).ToString()
  Next

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

13 个回复

倒序浏览
nicholas
初级会员   /  发表于:2014-7-16 10:09:00
沙发
如何实现将打印任务送给同一台电脑上的两台打印机
请帮忙提供相应代码
谢谢!
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-7-16 12:30:00
板凳
回复 2楼nicholas的帖子

将打印任务发送到两台打印机需要调用先指定不同打印机名称,两次 Print 方法实现:

  1.         Dim sr1 As New SectionReport1
  2.         sr1.Restart()
  3.         sr1.Run()

  4.         sr1.Document.Printer.PrinterName = "打印机1名称"
  5.         sr1.Document.Printer.Print()

  6.         sr1.Restart()
  7.         sr1.Run()

  8.         sr1.Document.Printer.PrinterName = "打印机2名称"
  9.         sr1.Document.Printer.Print()
复制代码


另外,请问您使用的是 AR7 吗?PageReport 还是 SectionReport?
回复 使用道具 举报
nicholas
初级会员   /  发表于:2014-7-16 12:36:00
地板
SectionReport
回复 使用道具 举报
nicholas
初级会员   /  发表于:2014-7-16 12:39:00
5#
AR7 ,SectionReport:
打印代码:
For i = 1 To 100
                          
                            Currentbarcode = '12345678001'
                           
                            Try
                                Dim rpt1 As New AR33_13
                                rpt1.Restart()
                                rpt1.Run()
                                rpt1.Document.Print(False)
                                System.Threading.Thread.Sleep(currentprintsleep)
                            Catch ex As Exception
                                MessageBox.Show(ex.Message)
                            End Try
                           
                            Currentbarcode = (CLng(Currentbarcode + 1)).ToString()
  Next
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-7-16 14:02:00
6#
回复 5楼nicholas的帖子

测试需要通过 Viewer 调用打印方法,我理解你的问题是分别调用同一台电脑上的两个打印机打印同一文档。
那么只需要分别制定打印机名称,调用打印方法即可,我使用两个虚拟打印机可以成功打印:


  1.     Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
  2.         Dim sr1 As New SectionReport1
  3.         sr1.Run()
  4.         Me.Viewer1.Document = sr1.Document
  5.     End Sub

  6.     Private Sub PrintToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PrintToolStripMenuItem.Click


  7.         Me.Viewer1.Document.Printer.PrinterName = "Send To OneNote 2013"
  8.         Me.Viewer1.Print(False)

  9.         Me.Viewer1.Document.Printer.PrinterName = "Microsoft XPS Document Writer"
  10.         Me.Viewer1.Print(False)

  11.     End Sub
复制代码


或者我没有理解你的意思,可以进一步解释下。
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-7-16 15:06:00
7#
如何使打印程序按打印机驱动设置切纸:
比如:打印机驱动设置每打印10张切纸一次

For i = 1 To 100
                          
                            Currentbarcode = '12345678001'
             ......
nicholas 发表于 2014-7-16 9:59:00


请查看附件Demo 看能否满足切纸需求:

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
nicholas
初级会员   /  发表于:2014-7-17 15:28:00
8#
你好,非常感谢你的帮助!
但,printING- document 数据发送速度过慢,
大约一秒钟发送一个打印数据。
可否加快printING- document 数据发送速度?
谢谢!

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复 使用道具 举报
iceman
社区贡献组   /  发表于:2014-7-17 17:17:00
9#
回复 8楼nicholas的帖子

nicholas 你好,
切纸的问题解决了吗?
这个发送过程我们目前还无法干预。实际项目中真的会每次打印 2000 页纸张吗?
回复 使用道具 举报
nicholas
初级会员   /  发表于:2014-7-18 09:25:00
10#
打印2000页属于正常工作,只是打印速度太慢了。
我之前可以的打印调用方式,打印速度是很快的:
      Dim rpt1 As New AR33_13
        rpt1.Restart()
        rpt1.Run()
        rpt1.Document.Print(False)
回复 使用道具 举报
12下一页
您需要登录后才可以回帖 登录 | 立即注册
返回顶部