VB.NET Barcode Generator Print Product Label Using Crystal Report

VB.NET Tutorial : using Crystal Report to Print Barcode Product label load from MySQL Database and ODBC connection in vb.net

VB.NET Tutorials : How to make simple Barcode Generator create in VB.NET and Print Barcode Product label using Crystal Report? This simple application will allow you to print Barcode product Labels using Report management (Crystal Report), You can set the number of the barcode where you want to print out and or you can do for all Barcode labels product just one click.

Please Read :
  1. How to create Barcode Generator Part 1
  2. Make Report using Crystal Report
To create Barcode Generator, you must download and Install "IDAutomationHC39M" Font into your computer, download from this link https://www.dropbox.com/s/71ttbh2hhwu79ud/IDAutomationHC39M.ttf?dl=0

VB.NET Barcode Generator

Create Project (Barcode Generator)

Open your visual studio and create new project. On your new project, please add new Item, we will create new report and load all Barcode labels to this report. Right Click on your project > Add > Add New Item >

VB.NET Barcode Generator
Figure 1- For more detail, please see the video tutorial at the end of this sessions
VB.NET Barcode Generator
Figure 2- For more detail, please see the video tutorial at the end of this sessions
VB.NET Barcode Generator
Figure 3- For more detail, please see the video tutorial at the end of this sessions
 On the Step 3 (Figure 3), i think you must watch the video tutorials above.

Create New Form (Form1.Vb)

After create the Barcode Report has done, please back to the Form1.Vb, and Add Button Control, TextBox Control and Crystal Report Ciewer COntrol, just design it look like this images :

VB.NET Barcode Generator
We will create source code to show the Barcode Product from database into Crystal Report Viewer.

Source Code Barcode Generator (Form1.Vb)


Imports System.Data.Odbc ' im using ODBC connection to database
Imports CrystalDecisions.CrystalReports.Engine ' import cr engine
Public Class Form1
    Dim connection As OdbcConnection
    Dim cR As New ReportDocument
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        cR.Load("c:\users\b0x\documents\visual studio 2015\Projects\BarcodeGenerator\BarcodeGenerator\Barcode.rpt")
    End Sub

    ' we will create a connection to database (MySQL Database)
    ' im using ODBC connection
    ' you can use OleDB, ADO.NET, etc

    Sub openConnection()
        Try
            connection = New OdbcConnection("DSN=db_penjualan;MultipleActiveResultSets=True")
            If connection.State = ConnectionState.Closed Then
                connection.Open()
            End If
        Catch ex As Exception
            MsgBox("Connection failed" + ex.ToString)
        End Try
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        openConnection()
        Dim sql As String = "SELECT * FROM as_products WHERE productBarcode='" & TextBox1.Text & "'"

        For i As Integer = 1 To Integer.Parse(TextBox2.Text) - 1
            sql = sql + "UNION ALL SELECT * FROM as_products WHERE productBarcode='" & TextBox1.Text & "'"
        Next
        Dim da As New OdbcDataAdapter(sql, connection) ' we will use dataadapter and dataset
        Dim ds As New DataSet
        da.Fill(ds, "as_products")

        cR.SetDataSource(ds)
        CrystalReportViewer1.ReportSource = cR
        da.Dispose()
        connection.Close()
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
        openConnection()
        Dim sql As String = "SELECT * FROM as_products"
        Dim da As New OdbcDataAdapter(sql, connection) ' we will use dataadapter and dataset
        Dim ds As New DataSet
        da.Fill(ds, "as_products")

        cR.SetDataSource(ds)
        CrystalReportViewer1.ReportSource = cR
        da.Dispose()
        connection.Close()
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Button3.Click
        Me.Close()
    End Sub

    Private Sub LinkLabel1_LinkClicked(sender As Object, e As LinkLabelLinkClickedEventArgs) Handles LinkLabel1.LinkClicked
        Process.Start("www.hc-kr.com")
    End Sub
End Class

Note : Please watch full video tutorial above

Video Tutorial How to Create Barcode Generator



Download Full Source Code
Download Example Databases

COMMENTS

Next Recomended


Feel free to code it up and send us a pull request.

Hi everyone, let's me know how much this lesson can help your work. Please Subscribe and Follow Our Social Media 'kodeajaib[dot]com' to get Latest tutorials and will be send to your email everyday for free!, Just hit a comment if you have confused. Nice to meet you and Happy coding :) all ^^



Follow by E-Mail


Name

ADO.NET,3,Ajax,6,Android,9,AngularJS,4,ASP.NET,4,Blogger Tutorials,7,Bootstrap,7,C++,1,Codeigniter,2,Cplusplus,6,Crystal Report,6,CSharp,25,Ebook Java,2,FlyExam,1,FSharp,3,Game Development,2,Java,35,JDBC,2,Laravel,84,Lumen,2,MariaDB,2,Ms Access,3,MySQL,31,ODBC,6,OleDB,1,PHP,14,PHP Framework,5,PHP MYSQLI,9,PHP OOP,5,Python,8,Python 3,4,SQL Server,4,SQLite,4,Uncategorized,5,Vb 6,2,Vb.Net,89,Video,48,Vue Js,4,WPF,2,Yii,3,
ltr
item
KODE AJAIB: VB.NET Barcode Generator Print Product Label Using Crystal Report
VB.NET Barcode Generator Print Product Label Using Crystal Report
VB.NET Tutorial : using Crystal Report to Print Barcode Product label load from MySQL Database and ODBC connection in vb.net
https://2.bp.blogspot.com/-ilm68l8g2IA/V6EOmOj1g-I/AAAAAAAACMY/KfEItlTOzAM-BfvFni6KR_ilBbvlUMf9wCLcB/s320/barcode-generator-vb-net-4.png
https://2.bp.blogspot.com/-ilm68l8g2IA/V6EOmOj1g-I/AAAAAAAACMY/KfEItlTOzAM-BfvFni6KR_ilBbvlUMf9wCLcB/s72-c/barcode-generator-vb-net-4.png
KODE AJAIB
https://www.kodeajaib.com/2016/08/crystal-barcode-generator-product-label-vbnet.html
https://www.kodeajaib.com/
https://www.kodeajaib.com/
https://www.kodeajaib.com/2016/08/crystal-barcode-generator-product-label-vbnet.html
true
3214704946184383982
UTF-8
Loaded All Posts Not found any posts VIEW ALL Readmore Reply Cancel reply Delete By Home PAGES POSTS View All RECOMMENDED FOR YOU LABEL ARCHIVE SEARCH ALL POSTS Not found any post match with your request Back Home Sunday Monday Tuesday Wednesday Thursday Friday Saturday Sun Mon Tue Wed Thu Fri Sat January February March April May June July August September October November December Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec just now 1 minute ago $$1$$ minutes ago 1 hour ago $$1$$ hours ago Yesterday $$1$$ days ago $$1$$ weeks ago more than 5 weeks ago Followers Follow THIS CONTENT IS PREMIUM Please share to unlock Copy All Code Select All Code All codes were copied to your clipboard Can not copy the codes / texts, please press [CTRL]+[C] (or CMD+C with Mac) to copy