Click here to Skip to main content
15,902,198 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Concept Clarification Pin
AliAmjad12-Sep-08 7:30
AliAmjad12-Sep-08 7:30 
GeneralRe: Concept Clarification Pin
Dave Kreskowiak12-Sep-08 7:49
mveDave Kreskowiak12-Sep-08 7:49 
GeneralRe: Concept Clarification Pin
AliAmjad12-Sep-08 8:07
AliAmjad12-Sep-08 8:07 
GeneralRe: Concept Clarification Pin
Paul Conrad12-Sep-08 9:04
professionalPaul Conrad12-Sep-08 9:04 
GeneralRe: Concept Clarification Pin
AliAmjad12-Sep-08 11:19
AliAmjad12-Sep-08 11:19 
GeneralRe: Concept Clarification Pin
Dave Kreskowiak12-Sep-08 12:18
mveDave Kreskowiak12-Sep-08 12:18 
AnswerRe: Concept Clarification Pin
Guffa12-Sep-08 11:28
Guffa12-Sep-08 11:28 
QuestionPrinter showing Spoling status after printing through VB application Pin
praveenhathwar11-Sep-08 21:11
praveenhathwar11-Sep-08 21:11 
Im trying to print to a 40 column printer through my VB Application. But the printer instead of printing it will keep showing Spooling status. Im Using Epson TM-U220PD Printer, VB 6.0 and Sql Server 2000 as Backend. Anybody plz help me out in this context. I need to solve this urgently...

Here is my code...


sql = "select * from ReportTable"
If rstemp.State = 1 Then rstemp.Close
rstemp.Open sql, con, adOpenStatic, adLockOptimistic
If rstemp.EOF = False Then
'Open "LPT1" For Output As #intFreeFile
Open App.Path & "\reports\Billing.txt" For Output As #1
Printer.Print ""
Printer.FontName = "Arial"
Printer.FontBold = False
Printer.FontSize = 8
Print #1, vbTab & Trim(rstemp!CompanyName)
Print #1, vbTab & Trim(rstemp!BranchName)
Print #1, Space(1) & Trim(rstemp!Address) & Trim(rstemp!Street)
Print #1, vbTab & Trim(rstemp!City) & "," & Trim(rstemp!Phone)
Print #1, Space(1) & "CST No:" & Space(1) & Trim(rstemp!CATName) & Space(2) & "KST No:" & Space(1) & Trim(rstemp!DeptName)
Print #1, Space(1) & "TIN No:" & Space(1) & Trim(rstemp!VATNo)
Print #1, "-------------------------------------"
Print #1, " CASH BILL "
Print #1, "-------------------------------------"
Print #1, "M/s: " & Trim(rstemp!EANCode)
Print #1, "BillNo: " & Trim(rstemp!slno)
Print #1, "Bill Dt: " & Trim(rstemp!a1Date) & Space(3) & "Time: " & Right(Trim(rstemp!a2date), 12)
Print #1, "-------------------------------------"
Print #1, "SN" & Space(1) & "Desc." & vbTab & Space(4) & "Qty" & Space(2) & "Rate" & Space(4) & "Amt"
Print #1, "-------------------------------------"
slno = 1
totitem = 0
totamt = 0
Do Until rstemp.EOF
If Len(rstemp!ItemName) <= 14 Then
Print #1, Space(1) & Trim(slno) & Space(1) & Trim(rstemp!ItemName) & Space(14 - Len(Trim(rstemp!ItemName))) & Space(3) & Trim(rstemp!Qty) & Space(3 - Len(Trim(rstemp!Qty))) & Space(2) & Trim(Format(rstemp!sp, "#0.00")) & Space(6 - Len(Trim(rstemp!sp))) & Space(2) & Trim(Format(rstemp!amount, "#0.00"))
totitem = totitem + Val(rstemp!Qty)
totamt = totamt + Val(rstemp!amount)
Else
str1 = Trim(Left(rstemp!ItemName, 14))
str2 = Trim(Mid(rstemp!ItemName, 15, 40))
Print #1, Space(1) & Trim(slno) & Space(1) & Trim(str1) & Space(14 - Len(Trim(str1))) & Space(3) & Trim(rstemp!Qty) & Space(3 - Len(Trim(rstemp!Qty))) & Space(2) & Trim(Format(rstemp!sp, "#0.00")) & Space(6 - Len(Trim(rstemp!sp))) & Space(2) & Trim(Format(rstemp!amount, "#0.00"))
totitem = totitem + Val(rstemp!Qty)
totamt = totamt + Val(rstemp!amount)
End If
slno = slno + 1
rstemp.MoveNext
Loop
Print #1, "-------------------------------------"
Print #1, " Total : " & Trim(totitem) & Space(3) & Trim(Format(totamt, "#0.00"))
Print #1, "-------------------------------------"
Print #1, "Some text goes here"
Print #1, "Goods once sold will not be exchanged or "
Print #1, "taken back. "
Print #1, "Some text goes here"
Print #1, "Some text goes here"
Print #1, "Some text goes here"

'Ejecting the page
Print #1, Chr$(12);

'Releasing the printer
Print #1, Chr$(27); "q";

Close #1
Else
'Do Nothing
End If
rstemp.Close
AnswerRe: Printer showing Spoling status after printing through VB application Pin
Paul Conrad12-Sep-08 5:45
professionalPaul Conrad12-Sep-08 5:45 
QuestionCalculating the CPU usage of ONE process with VB.NET 2003 Pin
Chaos Machine11-Sep-08 20:09
Chaos Machine11-Sep-08 20:09 
AnswerRe: Calculating the CPU usage of ONE process with VB.NET 2003 Pin
Dave Kreskowiak12-Sep-08 1:45
mveDave Kreskowiak12-Sep-08 1:45 
QuestionXML XPath search in vb.net Pin
japel11-Sep-08 12:10
japel11-Sep-08 12:10 
QuestionControl master/wave/mic of soundcard Pin
Me kiter11-Sep-08 8:01
Me kiter11-Sep-08 8:01 
AnswerRe: Control master/wave/mic of soundcard Pin
jzonthemtn11-Sep-08 10:05
jzonthemtn11-Sep-08 10:05 
Questionmetaphones Pin
lawasso11-Sep-08 4:16
lawasso11-Sep-08 4:16 
AnswerRe: metaphones Pin
leppie11-Sep-08 4:34
leppie11-Sep-08 4:34 
QuestionVBScript - View Source Pin
Reelix11-Sep-08 3:55
Reelix11-Sep-08 3:55 
AnswerRe: VBScript - View Source Pin
jzonthemtn11-Sep-08 6:24
jzonthemtn11-Sep-08 6:24 
GeneralRe: VBScript - View Source Pin
Reelix11-Sep-08 20:11
Reelix11-Sep-08 20:11 
QuestionVB.net Searching File for string Pin
Maffyx11-Sep-08 3:29
Maffyx11-Sep-08 3:29 
AnswerRe: VB.net Searching File for string Pin
jzonthemtn11-Sep-08 6:28
jzonthemtn11-Sep-08 6:28 
GeneralRe: VB.net Searching File for string Pin
Maffyx11-Sep-08 10:31
Maffyx11-Sep-08 10:31 
GeneralRe: VB.net Searching File for string Pin
Maffyx13-Sep-08 18:58
Maffyx13-Sep-08 18:58 
GeneralRe: VB.net Searching File for string Pin
Maffyx13-Sep-08 20:05
Maffyx13-Sep-08 20:05 
GeneralRe: VB.net Searching File for string Pin
Maffyx13-Sep-08 20:42
Maffyx13-Sep-08 20:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.