dcsimg
Results 1 to 2 of 2

Thread: how to print all data from datagrid??

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2009
    Posts
    108

    Question how to print all data from datagrid??

    Hi,
    Now I only can print selected row from datagrid, how to print all row from datagrid when I click the checkbox (print all)??

    see attachment

    Below is my code for print selected row:

    Code:
    If COM1.Value = True Then
    MSComm1.CommPort = 1
    Else
    COM1.Value = False
    LPT1.Value = True
    End If
    
    If LPT1.Value = False Then
        MSComm1.PortOpen = True
        
    If MSComm1.DSRHolding = False Then
        MsgBox "Printer Not Ready", vbCritical, "Error"
        MSComm1.PortOpen = False
        Exit Sub
    End If
    End If
    
    If MsgBox("      Are you sure to print", vbOKCancel, "Print") = vbCancel Then
    Exit Sub
    End If
    
    ccode = Format$(Data1.Recordset![code1])
    qtty = Format$(Val(Qtytxt2.Text), "0000")
    
    If LPT1.Value = True Then
    
    Printer.Print "{D0391,0919,0360|}"
    Printer.Print "{C|}"
    Printer.Print "{D0391,0919,0360|}"
    Printer.Print "{AX;+000,+000,+00|}"
    Printer.Print "{AY;+00,0|}"
    Printer.Print "{PC000;0116,0162,20,25,K,00,B|}"
    Printer.Print "{RC00;" & ccode & "|}"
    Printer.Print "{XB00;0210,0200,A,3,03,0,0144,+0000000000,000,0,00|}"
    Printer.Print "{RB00;>5>8>6" & ccode & "|}"
    Printer.Print "{XS;I," & qtty & ",0002C6200|}"
    
    Printer.EndDoc
    
    Else
    
    Printer.Print "{D0391,0919,0360|}"
    Printer.Print "{C|}"
    Printer.Print "{D0391,0919,0360|}"
    Printer.Print "{AX;+000,+000,+00|}"
    Printer.Print "{AY;+00,0|}"
    Printer.Print "{PC000;0116,0162,20,25,K,00,B|}"
    Printer.Print "{RC00;" & ccode & "|}"
    Printer.Print "{XB00;0210,0200,A,3,03,0,0144,+0000000000,000,0,00|}"
    Printer.Print "{RB00;>5>8>6" & ccode & "|}"
    Printer.Print "{XS;I," & qtty & ",0002C6200|}"
    
    Printer.EndDoc
    
    End If
    your help is much appreciated.
    Attached Images Attached Images  

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width