VBNET_Beginnner
Member
- Joined
- Mar 12, 2007
- Messages
- 11
- Programming Experience
- Beginner
Hi, im currently upgrading a system from vb6 to vb.net with no experience in vb.net at all. Thus, i have no idea on how to convert this vb6 code to vb.net. Ive tried looking into articles and forums regarding printing in vb.net, but i still cant seems to understand how to modify this.
Can anyone please help? Your help is very much appreciated.
Many thanks.
Below are my lines of coding :
Can anyone please help? Your help is very much appreciated.
Many thanks.
Below are my lines of coding :
VB.NET:
Private Sub WriteLine(vCount)
'Write file record
vXBLNR = Left(vKOSTL, 1) & "SV" & Mid(ctlBUDAT, 7, 2) & _
Mid(vHexMth, Val(Mid(ctlBUDAT, 3, 2)), 1) & Format(vCount, "000") 'YYH
Print #1, ctlBLDAT; ctlBLART; ctlBUKRS; ctlBUDAT; ctlMONAT; vXBLNR _
; ctlNEWBS; vCustCode; Format(vAmount, "0000000000.00") _
; ctlNEWBS1; ctlHKONT; vKOSTL; ctlAUFNR; ctlNAR1; ctlNAR2 _
; vNar3; vNar4
'Print report
If Printer.CurrentY >= 14400 Then
Printer.NewPage
WriteHeader
End If
Printer.Print , vCount, vKOSTL, vCustCode, vName
Printer.Print , , vXBLNR, ctlNAR1, , Format(vAmount, "000.00")
Printer.Print , , , , ctlNAR2
Printer.Print , , , , vNar3
If Len(Trim(vNar4)) > 0 Then
Printer.Print , , , , vNar4
End If
-------------------------------------------------------------
Private Sub WriteHeader()
Dim t As String
Dim p As Integer
Printer.FontSize = 10
t = "Userid: " & gUserID
Printer.CurrentY = 1440
Printer.CurrentX = 1440
Printer.Print t;
t = "Carlsberg Marketing Sdn. Bhd."
p = (Printer.Width - Printer.TextWidth(t)) / 2
Printer.CurrentX = p
Printer.Print t;
Printer.CurrentX = Printer.Width - 2880
Printer.Print Format(Now, "short date");
Printer.Print " " & Format(Now, "HH:MM")
t = "Wholesalers' Van Advertisement Credit Notes Listing"
p = (Printer.Width - Printer.TextWidth(t)) / 2
Printer.CurrentX = p
Printer.Print t;
Printer.CurrentX = Printer.Width - 2880
Printer.Print "Page No. " & Printer.Page
Printer.Print
Printer.Print , "No.", "S/Office", "Customer ", "Name"
Printer.Print , , "CN No.", , "Narration", , , "Amount"
Printer.Print
End Sub
Printer.Print
End Sub
Last edited by a moderator: