1,105,344 Community Members

Barcode Print

Member Avatar
pearl.kumar1
Light Poster
46 posts since Feb 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Hi to all,

This is the first time i can use barcode..anyone can suggest how to use coding () in VB.Net..
Private Sub Button3_Click(print_click)(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click

Actual VB6 Coding for the same module is..

Private Sub BTNPRINT_Click()
Dim cur_dat_tim As String
Dim copy As Integer
copy = txtcopy.Text
ipid = txtempid.Text
patient = txtemployeename.Text
age = txtage.Text
sex = txtsex.Text
doctor = txtdepartmentname.Text

SQL = "regd_regdetail_ipid " & txtempid.Text & " "
If rs.State Then rs.Close
rs.Open SQL, DBC, adOpenDynamic, adLockOptimistic

Open "lpt1:" For Output As #1
Print #1, "^Q25,1"
Print #1, "^W45"
Print #1, "^H10"
Print #1, "^P1"
Print #1, "^S4"
Print #1, "^AT"
Print #1, "^C1"
Print #1, "^R0"
Print #1, "~Q+0"
Print #1, "^O0"
Print #1, "^D0"
Print #1, "^E10"
Print #1, "~R200"
Print #1, "^L"
Print #1, "Dy2 -Me - dd"
Print #1, "Th: m: s"

Print #1, "AB,-95,0,2,2,0,0," & Employee
Print #1, "AB,-95,40,1,2,0,0,AGE:"
Print #1, "AB,-35,40,1,2,0,0," & age
Print #1, "AB,-95,80,1,2,0,0,SEX:"
Print #1, "AB,-35,80,1,2,0,0," & sex
Print #1, "AB,-95,120,1,2,0,0,empID:"
Print #1, "AB,35,120,1,2,0,0," & empid

'Print #1, "BA,200,120,3,7,48,0,0,4321"
Print #1, "AB,-95,0,2,2,0,0," & patient
Print #1, "AB,-95,40,1,2,0,0,AGE:"
Print #1, "AB,-35,40,1,2,0,0," & age
Print #1, "AB,-95,80,1,2,0,0,SEX:"
Print #1, "AB,-35,80,1,2,0,0," & sex
Print #1, "AB,-95,120,1,2,0,0,empid:"
Print #1, "AB,35,120,1,2,0,0," & empid
'Print #1, "BA,200,120,3,7,48,0,0,4321"
Print #1, "BA,130,120,3,7,50,0,0," & empid & ""
Print #1, "E"

Next

Close #1

MsgBox "Printed", vbInformation, "REGISTRATION"
Call CLEAR_Click
txtIPid.SetFocus

End Sub

I need to convert it from VB.net or please Suggest in the way of coding or Any referral Websites.

Member Avatar
tinstaafl
Postaholic
2,009 posts since Jun 2010
Reputation Points: 559 [?]
Q&As Helped to Solve: 400 [?]
Skill Endorsements: 35 [?]
 
0
 
Member Avatar
rockerjone
Newbie Poster
1 post since Apr 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

I think you can find your answer here(Actually, I suggest you use "barcode site:daniweb.com" in the google, then you can find many posts on barcode.):

http://www.daniweb.com/software-development/visual-basic-4-5-6/threads/55050/need-a-vb-code-for-barcode-printing

Member Avatar
mikepeal
Newbie Poster
7 posts since Mar 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
0
 

Actually, if you did not find ideal VB.NET code for printing barcode in daniweb, you can try to find sample code in stackflow.com.

tigerwoods11
Newbie Poster
1 post since Aug 2013
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
Unverified Member
 
0
 

Here is a sample code for creating QR Code in VB.NET:

Imports OnBarcode.Barcode


Dim barcode As QRCode = New QRCode

'QRCode Barcode Basic Settings

'QRCode Valid data char set:
'numeric data (digits 0 - 9);
'alphanumeric data (digits 0 - 9; upper case letters A -Z;
'nine other characters: space, $ % * + - . / : );
'byte data (default: ISO/IEC 8859-1);
'Kanji(characters)
barcode.Data = "112233445566"

barcode.DataMode = QRCodeDataMode.Auto
barcode.Version = QRCodeVersion.V1
barcode.ECL = QRCodeECL.L

'Set the ProcessTilde property to true,if you want use the tilde character "~" 
'to specify special characters in the input data. Default is false.

'1) 1-byte character: ~0dd/~1dd/~2dd (character value from 000 ~ 255);
'   ASCII character '~' is presented by ~126;
'   Strings from "~256" to "~299" are unused
'   modified to FS, GS, RS and US respectively.
'2) 2-byte character (Unicode): ~6ddddd (character value from 00000 ~ 65535)
'   Strings from "~665536" to "~699999" are unused
'3) for GS1 AI Code: 
'   ~ai2: AI with 2 digits
'   ~ai3: AI with 3 digits
'   ~ai4: AI with 4 digits
'   ~ai5: AI with 5 digits
'   ~ai6: AI with 6 digits
'   ~ai7: AI with 7 digits
'4) ECI: ~7dddddd (valid value of dddddd from 000000 to 999999)
'5) SJIS: from ~9ddddd (Shift JIS 0x8140 ~ 0x9FFC and 0xE040 ~ 0xEBBF)
barcode.ProcessTilde = True

' Barcode Size Related Settings
barcode.UOM = UnitOfMeasure.PIXEL
barcode.X = 3
barcode.LeftMargin = 0
barcode.RightMargin = 0
barcode.TopMargin = 0
barcode.BottomMargin = 0
barcode.Resolution = 96
barcode.Rotate = Rotate.Rotate0

' Image format setting
barcode.ImageFormat = System.Drawing.Imaging.ImageFormat.Gif()
barcode.drawBarcode("c://qr-code.gif")
You
This article has been dead for over three months: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article