| |
Živjo. Rabim pomoč pri programu VB. Naredila sem program za gostinstvo, vse lepo dela, ampak ne zazna mi oz. noče mi sprintati računa. In ker mi noče računa natisniti mi tudi se blagajna ne odpre.
Sem nastavla, na kater tiskalnik naj mi printa, ampak noče.. Prosim za pomoč, če kdo ve, zakaj mi ne printa.
Hvala in lp.Nanika87
changed: NikMan (22.10.2012, 13:29)
|
| |
| |
Lahko pokažeš del kode, ki skrbi za tiskanje?
|
| |
| |
Tole kodo sm drgac iz enga foruma dol potegnila,pa ne vem kje je napaka. 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(1 + LPad("Qty", 3) + Space(1) + Space(2) + LPad("Amount", 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(1 + cVl + LPad(flxgrd.TextMatrix(i, 3), 3) + Space(1) + Space(1) + LPad(Format(flxgrd.TextMatrix(i, 5), "####0.00"), ' Else ' Print #1, Space(nLM) + RPad(flxgrd.TextMatrix(i, 0), 3) + cVl + Chr(15) + RPad(Left(flxgrd.TextMatrix(i, 1), 30), 30) + Chr(1 + cVl + LPad(flxgrd.TextMatrix(i, 2), 3) + Space(1) + Chr(15) + LPad(Format(flxgrd.TextMatrix(i, 3), "###0.00"), 7) + Chr(1 + Space(1) + LPad(Format(flxgrd.TextMatrix(i, 4), "####0.00"), ' Print #1, Space(nLM) + Space(3) + cVl + Chr(15) + RPad(Mid(flxgrd.TextMatrix(i, 1), 22, Len(flxgrd.TextMatrix(i, 1))), 10) + Chr(1 + 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( + LPad(Format(lblTqty, "#####0"), 6) + Space + LPad(Format(lblTamt, "#####0.00"), 9) If Val(txtdR.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Less " + Chr(1 + Space(19) + LPad(Format(txtdR.Text, "####0.00"), 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(1 + Space(19) + LPad(Format(txtTax.Text, "####0.00"), If Val(txtAsc.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + " Add Sur Charge" + Format(nMaTax, "#0.00") + Chr(1 + Space(19) + LPad(Format(txtAsc.Text, "####0.00"),
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(1 + Space(19) + LPad(Format(txtTax.Text, "####0.00"), End If If Val(txtTrns.Text) <> 0 Then Print #1, Space(nLM) + Space(2) + Chr(15) + "Transport Charges " + Chr(1 + Space(19) + LPad(Format(txtTrns.Text, "####0.00"),
Print #1, Space(nLM) + Space(32) + String(8, "-") Print #1, Space(nLM) + Space(32) + Chr(27) + Chr(71) + LPad(Format(txtTot.Text, "####0.00"), + Chr(27) + Chr(72) Print #1, Space(17) + " Received :" + LPad(Format(txtAmtR.Text, "####0.00"), Print #1, Space(nLM) + Space(32) + String(8, "-") Print #1, Space(17) + " Balance :" + LPad(Format(txtAmtB.Text, "####0.00"), Print #1, Print #1, Print #1, Print #1, Chr(15) + cUser + Chr(1 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
|
| |
| |
Bi bila potem, ko ga narediš program pripravljena deliti z nami?
|
| |
| |
zdej zanima me pri tej kodi kaj misli z output, kaj naj noter vpisem? nevem kaj misli z outputom 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
|
| |
| |
ja mogoce, ce mi res rata se tole narest, pol ja
changed: nanika87 (22.10.2012, 20:09)
|
| |
| |
Ali se po zagonu tiskanja ustvari datoteka c:\files\testfile? Ali si s strani prenesla datoteko DOSPRINT.BAT in jo premaknila v mapo c:\files?
|
| |
| |
ne eno ne drugo.. kje pa se lahko prenese dosprint.bat? pa se neki,ali mi lahko napisete kodo,pa da pač vse na novo napisem. namrec nardila sem nov gumb z imenom print in zdj kaj morm vnest, da bo avtomatsko po koncanem izracunu zacel printat in da se tudi avtomatsko vrne na zacetek drugega racunanja..bolj ko hocm popravt slabs je, najbolj vse od zacetka napisat pa je zadeva finish :-)
|
| |
| |
Zadevo jemlješ skrajno premalo resno; na tak način in z zdajšnjo mero znanja boš težko sama naredila program, tudi z našo pomočjo.
Ne vem, od kod moraš prenesti datoteko. Kje si našla to kodo za tiskanje?
|
| |
| |
no evvo še enkkrat koda za printanje in kje me opozori
'Printimi ****************************** Open App.Path & "\Raporti.txt" For Output As #1 Printer.FontName = "Courier New" Printer.FontSize = 9 Print #1, " " Close #1 Open App.Path & "\Raporti.txt" For Append As #1 Print #1, lblfirma.Caption Print #1, " " Print #1, "NIB : "; lblnib.Caption Print #1, Format(Now, "dd/mm/yyyy") & " " & Format(Now, "hh:mm:ss") Print #1, "Arka :" & lblarka.Caption & " " & "Paragoni NR :" & frmShitja.lblnumri.Caption Print #1, " " Print #1, "........................................" Print #1, " " For ii = 1 To frmShitja.lvshitja.ListItems.Count Print #1, frmShitja.lvshitja.ListItems(ii).SubItems(1) Print #1, " " & frmShitja.lvshitja.ListItems(ii).SubItems(2) & " x "; frmShitja.lvshitja.ListItems(ii).SubItems(3) & " = " & frmShitja.lvshitja.ListItems(ii).SubItems(4) Next Print #1, " " Print #1, "........................................." Print #1, "" Dim lngSpace As Long
Print #1, "TOTALI : " & Space(lngSpace) & Format(txttotal, "###,##0.00") & " " Print #1, "PAGUAR : " & Space(lngSpace) & Format(txtpaguar, "###,##0.00") & " " Print #1, "KUSURI : " & Space(lngSpace) & Format(txtkusuri, "###,##0.00") & " "
Print #1, " " Print #1, " " Print #1, "TVSH është llogaritur në çmim" Print #1, " " Print #1, "Ju faleminderit!!" Print #1, " " Close #1 If lblprint.Caption = "PO" Then Shell App.Path & "\prnt_fat.exe", vbHide ((((tuki me opozori))))) End If '*******End Print********************************************************* WriteINI App.Path & "\Paragoni.ini", "Numri", "Numri", frmShitja.lblnumri + 1 Dim Arq1 As String Arq1 = ReadINI(App.Path & "\Paragoni.ini", "Numri", "Numri") frmShitja.lblnumri.Caption = Arq1 frmShitja.lvshitja.ListItems.Clear frmShitja.lbltotal.Caption = "0.00" On Error Resume Next LCD_Command (LCD_CLR) frmShitja.MSComm1.Output = txbuff LCD_Command (LCD_CLR) frmShitja.MSComm1.Output = txbuff LCD_Command (NEXT_LINE) frmShitja.MSComm1.Output = txbuff txbuff = "> B I G S T A R <" frmShitja.MSComm1.Output = txbuff Unload Me End If End Sub
|
| |
Prikazujem 1 od skupno 2 strani |
|