Rasheed Shaik
Programmer
How to print a data report in Network Printer in a VB 6 application?
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private rs As New ADODB.recordset
Dim obj As PageSet.PrinterControl
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub cmdOK_Click()
Dim prt As Printer
For Each prt In Printers
If prt.DeviceName = "MyPrinterName" Then
Set Printer = prt
Exit For
End If
Next
Set obj = New PrinterControl
obj.ChngOrientationLandscape
rs.Open "select * from cheques where mata = '" & pro.Text & "' and status = '" & sta.Text & "'", con, 1, 3
If rs.RecordCount = 0 Then
MsgBox "No record found on query.", vbCritical, "Medrar"
Else
Set FullReport.DataSource = rs
Unload Me
FullReport.Print
End If
Set rs = Nothing
End Sub
printer.print Fullreport
printer.enddoc