C
CompuTechSide
Guest
I want to send direct print on the printer without view, I have applied this if more new information else of these printing option tell me with example.
Error on this first line (Dim P As New PrinterClass(Application.StartupPath)
Error Printer class not define ?
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim P As New PrinterClass(Application.StartupPath)
With P
'Printing Title
.FeedPaper(4)
.AlignCenter()
.BigFont()
.Bold = True
.WriteLine("Invoice")
'Printing Date
.GotoSixth(1)
.NormalFont()
.WriteChars("Date:")
.WriteLine(DateTime.Now.ToString)
.DrawLine()
.FeedPaper(2)
'Printing Header
.GotoSixth(1)
.WriteChars("#")
.GotoSixth(2)
.WriteChars("Description")
.GotoSixth(5)
.WriteChars("Count")
.GotoSixth(6)
.WriteChars("Total")
.WriteLine("")
.DrawLine()
'Printing Items
.SmallFont()
Dim i As Integer
For i = 1 To 6
.GotoSixth(1)
.WriteChars(i)
.GotoSixth(2)
.WriteChars("Item# " & (Rnd() * 100) \ 1)
.GotoSixth(5)
.WriteChars(Rnd() * 10 \ 1)
.GotoSixth(6)
.WriteChars((Rnd() * 50 \ 1) & " JD(s)")
.WriteLine("")
Next
'Printing Totals
.NormalFont()
.DrawLine()
.GotoSixth(1)
.UnderlineOn()
.WriteChars("Total")
.UnderlineOff()
.GotoSixth(5)
.WriteChars((Rnd() * 300 \ 1) & " JD(s)")
.CutPaper()
.EndDoc()
End With
End
End Sub
Continue reading...
Error on this first line (Dim P As New PrinterClass(Application.StartupPath)
Error Printer class not define ?
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim P As New PrinterClass(Application.StartupPath)
With P
'Printing Title
.FeedPaper(4)
.AlignCenter()
.BigFont()
.Bold = True
.WriteLine("Invoice")
'Printing Date
.GotoSixth(1)
.NormalFont()
.WriteChars("Date:")
.WriteLine(DateTime.Now.ToString)
.DrawLine()
.FeedPaper(2)
'Printing Header
.GotoSixth(1)
.WriteChars("#")
.GotoSixth(2)
.WriteChars("Description")
.GotoSixth(5)
.WriteChars("Count")
.GotoSixth(6)
.WriteChars("Total")
.WriteLine("")
.DrawLine()
'Printing Items
.SmallFont()
Dim i As Integer
For i = 1 To 6
.GotoSixth(1)
.WriteChars(i)
.GotoSixth(2)
.WriteChars("Item# " & (Rnd() * 100) \ 1)
.GotoSixth(5)
.WriteChars(Rnd() * 10 \ 1)
.GotoSixth(6)
.WriteChars((Rnd() * 50 \ 1) & " JD(s)")
.WriteLine("")
Next
'Printing Totals
.NormalFont()
.DrawLine()
.GotoSixth(1)
.UnderlineOn()
.WriteChars("Total")
.UnderlineOff()
.GotoSixth(5)
.WriteChars((Rnd() * 300 \ 1) & " JD(s)")
.CutPaper()
.EndDoc()
End With
End
End Sub
Continue reading...