我想通过VB程序中的REPORT在打印时直接打印出条形码,请问有什么办法?请各位高手指教。

解决方案 »

  1.   

    你想通过Report直接打印条码?偶不知道你的打印机支不支持打印条码,如果不支持,那就没办法了:)
      

  2.   

    VB应用程序中打印条形码的两种方法
    http://www0.ccidnet.com/tech/guide/2000/05/12/58_695.html
      

  3.   

    但是我试了一下,还是要分两页打印,请问能不能举个例子,我是如下写语句的:
    通用模块:
    Public Declare Function MoveToEx Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, lpPoint As POINTAPI) As Long
     
    '从画笔的当前位置到(x,y)画一条线
     
    Public Declare Function LineTo Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
     
    '在(x,y)处输出一个字符串
     
    Public Declare Function TextOut Lib "gdi32" Alias "TextOutA" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal lpString As String, ByVal nCount As Long) As Long
     
    'MoveToEx()  函数需要的参数
     
    Public Type POINTAPI
     
           xp  As Long
     
           yp  As Long
     
    End Type
    Dim papi   As POINTAPI
     
     
    Public Sub PrintBarCode(ByVal Pic As Object, ByVal PrintDC As Long, ByVal strBarCode As String, Optional ByVal intXPos As Integer = 0, Optional ByVal intYPos As Integer = 0, Optional ByVal intPrintHeight As Integer = 10, Optional ByVal bolPrintText As Boolean = True)
       ......(语句是参考http://community.csdn.net/Expert/FAQ/FAQ_Index.asp?id=12211)
    end sub
    打印窗体中的语句:
    Private Sub Command1_Click()
    PrintBarCode Printer, 10, Form2.Text1, , , , True     '打印条形码发货单号
    DataReport1.PrintReport   '打印此发货单的其他内容  
    End Sub
    请各位高手帮我出出主意,我已没有办法了!