 |
nirmal Level: Guest

|
Re: Bill Printing
You only need to set papersize property of printer object according to height of your bill. Set papersize before you start writing printing code, this will solve your problem.
|
|
|
14-10-2003 at 01:26 PM |
|
|  |
|
|
caloy Level: Trainee
 Registered: 15-03-2006 Posts: 3
|
Re: Bill Printing
am using DOS printing so it would print fast. im trying to print the contents of my flexgrid. i have used the .printpicture of flexgrid but it still eject some papers..
the code above doesnt work with me... it still throws up some paper even after i have set the paper size... i cnat even set the font...
i have the code below... maybe you could help the novice....
Open "LPT1" For Output As #1
Print #1, ""
Print #1, ""
Print #1, Tab(7); resibo.Label1(0)
Print #1, resibo.Label1(1)
Print #1, ""
Print #1, ""
For i = 0 To w - 5
Print #1, .TextMatrix(i, 1); Tab(5) _
; Left(.TextMatrix(i, 2), 15), _
.TextMatrix(i, 3)
Next i
For i = i To w
Print #1, .TextMatrix(i, 2), , _
.TextMatrix(i, 3)
Next i
Print #1, ""
Print #1, ""
Print #1, ""
Print #1, ""
Close #1
maybe if you could hel me modify it to format my receipt.
|
|
15-03-2006 at 08:50 AM |
|
|
soumen Level: Trainee
 Registered: 08-08-2006 Posts: 1
|
Re: Bill Printing
It is throwing some paper because of page setting.
I think set the paper in such a manner that is better for the printing.If the printer has custom page setting then use the option.
If it not helping you please mail me.
____________________________
soumen
|
|
08-08-2006 at 04:13 AM |
|
|
senthil Level: Trainee
 Registered: 04-11-2006 Posts: 1
|
Re: Bill Printing
pls reply for problem in code
dos printing in vb in difference font size, how to use
chr$ - function ho to use
|
|
04-11-2006 at 03:23 PM |
|
|
ssn Level: Trainee
 Registered: 07-04-2007 Posts: 1
|
Re: Bill Printing
I am using PRINT #1, to write text in a file and i m printing it using edit.com. even i tried to send ESC command to set page length in lines. even after that once the printing over it ejects the paper a lot. My paper is a roll paper of 40 character width. Please help me how to stop the ejection of paper. Once print over i want it to stop there itself.
|
|
07-04-2007 at 01:43 PM |
|
|
gunpath Level: Trainee
 Registered: 17-09-2007 Posts: 1
|
Re: Bill Printing
Private Sub CashPrint()
Dim cPaid As String, cBbal As String
Dim nWgt As String, nQty As String, cTotwgt As String, cLess As String
Dim nLM As Integer, cVl As String, nBG As Integer, cHl As String
Dim nTotAmt As Double, nTotQty, nTRAmt As Double
Dim nTlen, nLoop, nInc As Integer, cString As String
nLM = 0
cVl = " "
cHl = "-"
Open "c:\files\testfile" For Output As #1 ' Open file for output.
For l = 1 To 4
Print #1, Chr(27) + "j" + "n"
Next
'############### Head Printing #################
Print #1,
Print #1, Space(nLM) + CPad(CboCaCr.Text, 40)
Print #1, Space(nLM) + Space(1) + "No." + RPad(Left(Trim(txtBNo.Text), 6), 6) + Space(15) + "Date:" + txtBDt.Text
If txtpartyname.Text <> "" Then
Print #1, Space(nLM) + Chr$(27) + Chr$(71) + "M/s " + Trim(txtpartyname.Text) + Chr(27) + Chr$(72)
Else
Print #1, Space(nLM) + Chr$(27) + Chr$(71) + "M/s " + Trim(txtName.Text) + Chr(27) + Chr$(72)
End If
If TxtAdd1.Text <> "" Then Print #1, Space(nLM) + TxtAdd1.Text
If TxtAdd2.Text <> "" Then Print #1, Space(nLM) + TxtAdd2.Text
If txtadd3.Text <> "" Then Print #1, Space(nLM) + txtadd3.Text
' Print #1, Space(nLM) + Space(1) + "Date:" + txtBDt.Text + Space(5) + " Time:" + txtTime.Text
'############ End Of Head Printing #################
'############ Body Printing #################
' If TxtAdd4.Text <> "" Then Print #1, Space(nLM) + TxtAdd4.Text
'******///////////////////Credit Bill /////////////////////// Starts here
' Print #1, Space(nLM) + cString
' If i = 1 Then
' nInc = nInc + 34
' Else
' nInc = nInc + 40
' End If
' Next
' End If
' End If
Print #1, Space(nLM) + String(40, "=")
Print #1, Space(nLM) + RPad("Rate", 7) + cVl + Chr(15) + CPad("Particulars ", 30) + Chr(18) + LPad("Qty", 3) + Space(1) + Space(2) + LPad("Amount", 8)
Print #1, Space(nLM) + String(40, "=")
For i = 1 To flxgrd.Rows - 1
If flxgrd.TextMatrix(i, 1) <> "" Then
If Val(flxgrd.TextMatrix(i, 3)) <> 0 Then
' If Len(Trim(flxgrd.TextMatrix(i, 1))) < 22 Then
Print #1, Space(nLM) + LPad(Format(flxgrd.TextMatrix(i, 4), "###0.00"), 7) + cVl + Chr(15) + RPad(Left(Trim(flxgrd.TextMatrix(i, 2)), 30), 30) + Chr(18) + cVl + LPad(flxgrd.TextMatrix(i, 3), 3) + Space(1) + Space(1) + LPad(Format(flxgrd.TextMatrix(i, 5), "####0.00"), 8)
' Else
' Print #1, Space(nLM) + RPad(flxgrd.TextMatrix(i, 0), 3) + cVl + Chr(15) + RPad(Left(flxgrd.TextMatrix(i, 1), 30), 30) + Chr(18) + cVl + LPad(flxgrd.TextMatrix(i, 2), 3) + Space(1) + Chr(15) + LPad(Format(flxgrd.TextMatrix(i, 3), "###0.00"), 7) + Chr(18) + Space(1) + LPad(Format(flxgrd.TextMatrix(i, 4), "####0.00"), 8)
' Print #1, Space(nLM) + Space(3) + cVl + Chr(15) + RPad(Mid(flxgrd.TextMatrix(i, 1), 22, Len(flxgrd.TextMatrix(i, 1))), 10) + Chr(18) + cVl
' End If
End If
' nTotAmt = nTotAmt + Val(flxgrd.TextMatrix(i, 5))
' nTotQty = nTotQty + Val(flxgrd.TextMatrix(i, 3))
End If
Next
Print #1, Space(nLM) + String(42, "-")
Print #1, Space(nLM) + Space(2) + "Total " + Space(8) + LPad(Format(lblTqty, "#####0"), 6) + Space(6) + LPad(Format(lblTamt, "#####0.00"), 9)
If Val(txtdR.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Less " + Chr(18) + Space(19) + LPad(Format(txtdR.Text, "####0.00"), 8)
If cboTax.ListIndex = 0 Then
If Val(txtTax.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Sales Tax @" + Format(nMTax, "#0.00") + Chr(18) + Space(19) + LPad(Format(txtTax.Text, "####0.00"), 8)
If Val(txtAsc.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Add Sur Charge" + Format(nMaTax, "#0.00") + Chr(18) + Space(19) + LPad(Format(txtAsc.Text, "####0.00"), 8)
ElseIf cboTax.ListIndex = 1 Then
If Val(txtTax.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " V.A.T @" + Format(nMVat, "#0.00") + Str(cboTax.ItemData(ListIndex)) + Chr(18) + Space(19) + LPad(Format(txtTax.Text, "####0.00"), 8)
End If
If Val(txtTrns.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + "Transport Charges " + Chr(18) + Space(19) + LPad(Format(txtTrns.Text, "####0.00"), 8)
Print #1, Space(nLM) + Space(32) + String(8, "-")
Print #1, Space(nLM) + Space(32) + Chr(27) + Chr(71) + LPad(Format(txtTot.Text, "####0.00"), 8) + Chr(27) + Chr(72)
Print #1, Space(17) + " Received :" + LPad(Format(txtAmtR.Text, "####0.00"), 8)
Print #1, Space(nLM) + Space(32) + String(8, "-")
Print #1, Space(17) + " Balance :" + LPad(Format(txtAmtB.Text, "####0.00"), 8)
Print #1,
Print #1,
Print #1,
Print #1, Chr(15) + cUser + Chr(18)
Print #1,
Print #1,
'//////////////// FOR CASH BILL PRINTING procedure ends here
For K = 1 To 11
Print #1,
Next
Close #1
Do While True
RetVal = Shell("C:\FILES\DOSPRINT.BAT", 0)
If MsgBox("Print Again", vbOKCancel) = vbCancel Then
Exit Do
End If
Loop
End Sub
|
|
17-09-2007 at 01:37 PM |
|
|
Joni Level: Trainee
 Registered: 06-03-2009 Posts: 2
|
Re: Bill Printing
Hi guys,
i wanted to ask if there is anyone on this discussion board who has figured the bill printing mechanism in vb6. Can anyone happen to print from a flexgrid directly to a printer? I have seen Gunpath's code, whichis interseting, but i had a problem in figuring out some of the keywords (CPad, LPad, RPad)..can anyone be of any help pls...i thankyou in advance....
am waiting.....
|
|
06-03-2009 at 08:57 PM |
|
|
Joni Level: Trainee
 Registered: 06-03-2009 Posts: 2
|
Re: Bill Printing
hello guys,
I have figured it out. I have successfully used the code above. I really thanks Gunpath for his code. If there is anyone who needs how i used it, u can write it here and i will post it for everyone to learn. Thanks again for all and for andreavb....
|
|
06-03-2009 at 10:51 PM |
|
|
vbsoftwaresupport Level: Trainee
 Registered: 25-01-2010 Posts: 2
|
Re: Bill Printing
quote: Joni wrote:
hello guys,
I have figured it out. I have successfully used the code above. I really thanks Gunpath for his code. If there is anyone who needs how i used it, u can write it here and i will post it for everyone to learn. Thanks again for all and for andreavb....
please help me !!!!!!!!!
how to connect this code in vb6.0 please send a brief idea about that......
|
|
28-01-2010 at 06:09 AM |
|
|
dsr Level: Trainee
 Registered: 25-04-2011 Posts: 2
|
Re: Bill Printing
quote: gunpath wrote:
Private Sub CashPrint()
Dim cPaid As String, cBbal As String
Dim nWgt As String, nQty As String, cTotwgt As String, cLess As String
Dim nLM As Integer, cVl As String, nBG As Integer, cHl As String
Dim nTotAmt As Double, nTotQty, nTRAmt As Double
Dim nTlen, nLoop, nInc As Integer, cString As String
nLM = 0
cVl = " "
cHl = "-"
Open "c:\files\testfile" For Output As #1 ' Open file for output.
For l = 1 To 4
Print #1, Chr(27) + "j" + "n"
Next
'############### Head Printing #################
Print #1,
Print #1, Space(nLM) + CPad(CboCaCr.Text, 40)
Print #1, Space(nLM) + Space(1) + "No." + RPad(Left(Trim(txtBNo.Text), 6), 6) + Space(15) + "Date:" + txtBDt.Text
If txtpartyname.Text <> "" Then
Print #1, Space(nLM) + Chr$(27) + Chr$(71) + "M/s " + Trim(txtpartyname.Text) + Chr(27) + Chr$(72)
Else
Print #1, Space(nLM) + Chr$(27) + Chr$(71) + "M/s " + Trim(txtName.Text) + Chr(27) + Chr$(72)
End If
If TxtAdd1.Text <> "" Then Print #1, Space(nLM) + TxtAdd1.Text
If TxtAdd2.Text <> "" Then Print #1, Space(nLM) + TxtAdd2.Text
If txtadd3.Text <> "" Then Print #1, Space(nLM) + txtadd3.Text
' Print #1, Space(nLM) + Space(1) + "Date:" + txtBDt.Text + Space(5) + " Time:" + txtTime.Text
'############ End Of Head Printing #################
'############ Body Printing #################
' If TxtAdd4.Text <> "" Then Print #1, Space(nLM) + TxtAdd4.Text
'******///////////////////Credit Bill /////////////////////// Starts here
' Print #1, Space(nLM) + cString
' If i = 1 Then
' nInc = nInc + 34
' Else
' nInc = nInc + 40
' End If
' Next
' End If
' End If
Print #1, Space(nLM) + String(40, "=")
Print #1, Space(nLM) + RPad("Rate", 7) + cVl + Chr(15) + CPad("Particulars ", 30) + Chr(18) + LPad("Qty", 3) + Space(1) + Space(2) + LPad("Amount", 8)
Print #1, Space(nLM) + String(40, "=")
For i = 1 To flxgrd.Rows - 1
If flxgrd.TextMatrix(i, 1) <> "" Then
If Val(flxgrd.TextMatrix(i, 3)) <> 0 Then
' If Len(Trim(flxgrd.TextMatrix(i, 1))) < 22 Then
Print #1, Space(nLM) + LPad(Format(flxgrd.TextMatrix(i, 4), "###0.00"), 7) + cVl + Chr(15) + RPad(Left(Trim(flxgrd.TextMatrix(i, 2)), 30), 30) + Chr(18) + cVl + LPad(flxgrd.TextMatrix(i, 3), 3) + Space(1) + Space(1) + LPad(Format(flxgrd.TextMatrix(i, 5), "####0.00"), 8)
' Else
' Print #1, Space(nLM) + RPad(flxgrd.TextMatrix(i, 0), 3) + cVl + Chr(15) + RPad(Left(flxgrd.TextMatrix(i, 1), 30), 30) + Chr(18) + cVl + LPad(flxgrd.TextMatrix(i, 2), 3) + Space(1) + Chr(15) + LPad(Format(flxgrd.TextMatrix(i, 3), "###0.00"), 7) + Chr(18) + Space(1) + LPad(Format(flxgrd.TextMatrix(i, 4), "####0.00"), 8)
' Print #1, Space(nLM) + Space(3) + cVl + Chr(15) + RPad(Mid(flxgrd.TextMatrix(i, 1), 22, Len(flxgrd.TextMatrix(i, 1))), 10) + Chr(18) + cVl
' End If
End If
' nTotAmt = nTotAmt + Val(flxgrd.TextMatrix(i, 5))
' nTotQty = nTotQty + Val(flxgrd.TextMatrix(i, 3))
End If
Next
Print #1, Space(nLM) + String(42, "-")
Print #1, Space(nLM) + Space(2) + "Total " + Space(8) + LPad(Format(lblTqty, "#####0"), 6) + Space(6) + LPad(Format(lblTamt, "#####0.00"), 9)
If Val(txtdR.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Less " + Chr(18) + Space(19) + LPad(Format(txtdR.Text, "####0.00"), 8)
If cboTax.ListIndex = 0 Then
If Val(txtTax.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Sales Tax @" + Format(nMTax, "#0.00") + Chr(18) + Space(19) + LPad(Format(txtTax.Text, "####0.00"), 8)
If Val(txtAsc.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Add Sur Charge" + Format(nMaTax, "#0.00") + Chr(18) + Space(19) + LPad(Format(txtAsc.Text, "####0.00"), 8)
ElseIf cboTax.ListIndex = 1 Then
If Val(txtTax.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " V.A.T @" + Format(nMVat, "#0.00") + Str(cboTax.ItemData(ListIndex)) + Chr(18) + Space(19) + LPad(Format(txtTax.Text, "####0.00"), 8)
End If
If Val(txtTrns.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + "Transport Charges " + Chr(18) + Space(19) + LPad(Format(txtTrns.Text, "####0.00"), 8)
Print #1, Space(nLM) + Space(32) + String(8, "-")
Print #1, Space(nLM) + Space(32) + Chr(27) + Chr(71) + LPad(Format(txtTot.Text, "####0.00"), 8) + Chr(27) + Chr(72)
Print #1, Space(17) + " Received :" + LPad(Format(txtAmtR.Text, "####0.00"), 8)
Print #1, Space(nLM) + Space(32) + String(8, "-")
Print #1, Space(17) + " Balance :" + LPad(Format(txtAmtB.Text, "####0.00"), 8)
Print #1,
Print #1,
Print #1,
Print #1, Chr(15) + cUser + Chr(18)
Print #1,
Print #1,
'//////////////// FOR CASH BILL PRINTING procedure ends here
For K = 1 To 11
Print #1,
Next
Close #1
Do While True
RetVal = Shell("C:\FILES\DOSPRINT.BAT", 0)
If MsgBox("Print Again", vbOKCancel) = vbCancel Then
Exit Do
End If
Loop
End Sub
Can you please send the Vb.net code for the above one....I am struggling here
|
|
25-04-2011 at 05:18 AM |
|
|
dsr Level: Trainee
 Registered: 25-04-2011 Posts: 2
|
Re: Bill Printing
Hi to All,
I want to do the same in web application using vb.net...
So please tell me how to write the above code in vb.net 2008....
Thanks in advance
|
|
25-04-2011 at 05:27 AM |
|
|
collergeo Level: Trainee
 Registered: 19-09-2011 Posts: 1
|
Re: Bill Printing
I'm trying to print bills in dot matrix printer thru VB program. It's working fine. But my problem is after taking 1st page printing when I tear off the page, the printer is not rolling back the extra page ejected in time of tearing off. Can any one help to sort out this problem.
____________________________
online printing company
|
|
19-09-2011 at 09:19 PM |
|
|
accounts Level: Trainee
 Registered: 15-12-2011 Posts: 2
|
Re: Bill Printing
pl help us v r trying to print on a pre printed paper through excel....but the dot matrix printer is ejecting the whole paper(A4 type)....we want the printer to stop and start there r 3 cheques on a single sheet of paper...
|
|
15-12-2011 at 11:47 AM |
|
|
|
|
 |
 |