Avapose.Barcode for Crystal Reports

- Reliable Code 128 barcode creator library & DLL for Crystal Report .NET
- Easily print Code 128 in Crystal Reports in ASP.NET and .NET WinForms projects
- Generate high quality Code 128 barcode images in Crystal Reports
Code 128 Barcode Generator for Crystal Report
- Integrate Code 128 generation features into Crystal Report for .NET
- Crystal Reports for Windows and ASP.NET are supported
- Provide C#.NET and VB.NET sample codes to developers
- Written entirely in managed C# with strong named assemblies
- Add auto data mode that makes data mode setting easy
- Support variations of Code 128 barcode images including GS1-128
- Compatible with ISO / IEC 15417 (2nd edition 2007-06-01)
- Offer royalty-free distribution licenses to purchasers
Code 128 Barcode Generator Control for Crystal Report provides .NET programmer with an easy-to-use solution for Code 128 generation in Crystal Reports. The generator is a powerful .NET component, which could be integrated into Crystal Reports for .NET along with its features for Code 128 barcode iamge generation.
Code 128 Barcode Generator for Crystal Report - Code 128 Information
Code 128 is an alphanumeric linear symbology used in a variety of industries. The symbology is of high density therefore large data could be carried. One of its subsets, GS1-128, is used worldwide in shipping and packaging industries.
Code 128 Barcode Generator DLL for Crystal Report encodes:
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
- Uppercase letters (A - Z)
- Lowercase letters (a - z)
- - (Dash), $ (Dollar), % (Percentage), (Space), . (Point), / (Slash), + (Plus)
Code 128 Barcode Generator for Crystal Report - Code 128 Generation
Environment Requirement
Before generating Code 128 in .NET, you need to install:
- Windows 7, Windows Vista, or Windows XP
- .NET 2.0, 3.0 or later version
- Microsoft Visual Studio 2005/2008/2010 with Crystal Report Wizard
- Avapose.Barcode for Crystal Report
Creating a Crystal Report for .NET
- Open your Visual Studio and create a new project;
- Select the Crystal Report template for Visual C# or Visual Basic;
- Name and locate the report;
- When the Crystal Report Gallery dialog box appears, accept the defaults of "Use Report Expert" and "Standard Report", and click "OK";
- When Crystal Reports wizard dialogue pops up, expand "Create New Connection", and click "ADO.NET";
- Browse and find "CustomerDataSet.xsd" in your downloaded sample dataset package (or any other dataset of your own), then click "Finish";
Fields and Style Setting
- Click on the Tables node to expand;
- Drag and drop the table name to the window titled Tables In Report, and click "Next";
- To display fields on the report, select them at the Field tab, and click "Finish";
- Modify the form so that it can preview and print the report;
Integration of Code 128 Barcode Generator for Crystal Report
- Drag and drop the field named "Barcode" to the report in Crystal Report1.rpt;
- Open Form1.cs in Design view, and add Avapose.linearbarcode.winforms.dll to the project reference;
- Double click Form1 to enter Form1.cs, and copy the sample code into the method Form_Load;
- Using the namespace "Avapose.linearbarcode" if your report is created in C#.NET;
- Run the report;
C# code
privatevoid Form1_Load(object sender, EventArgs e)
{
OleDbConnection aConnection = new OleDbConnection(
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:/Demo/BarcodeDemoData.mdb");
aConnection.Open();
OleDbDataAdapter dataAdapter = new OleDbDataAdapter("select * from Customer"
, aConnection);
DataSet ds = new DataSet();
dataAdapter.Fill(ds);
//add a new column named "Barcode" to the DataSet, the new column data type is
byte[]
ds.Tables[0].Columns.Add(new DataColumn("Barcode", typeof(byte[])));
Linear Barcode = new Linear();
Barcode. LinearBarcode = LinearBarcode.Code128;
foreach (DataRow dr in ds.Tables[0].Rows)
{
Barcode.BarcodeData = (int)dr["CustomerId"] + "";
byte[] imageData = Barcode.drawBarcodeAsBytes();
dr["Barcode"] = imageData;
}
CrystalReport1 rpt = new CrystalReport1();
rpt.SetDataSource(ds);
this.crystalReportViewer1.ReportSource = rpt;
aConnection.Close();
VB code
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs)
Handles MyBase.Load
Dim aConnection As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=C:/Demo/BarcodeDemoData.mdb")
aConnection.Open()
Dim dataAdapter As New OleDbDataAdapter("select * from Customer", aConnection)
Dim ds As New DataSet()
dataAdapter.Fill(ds)
'add a new column named "Barcode" to the DataSet, the new column data type is
byte[]
ds.Tables(0).Columns.Add(New DataColumn("Barcode", GetType(Byte())))
Dim Barcode As new Linear()
Barcode. LinearBarcode = LinearBarcode.Code128
For Each dr As DataRow In ds.Tables(0).Rows
Barcode.BarcodeData = CInt(dr("CustomerId")) & ""
Dim imageData As Byte() = Barcode.drawBarcodeAsBytes()
dr("Barcode") = imageData
Next
Dim rpt As New CrystalReport1()
rpt.SetDataSource(ds)
Me.CrystalReportViewer1.ReportSource = rpt
aConnection.Close()
End Sub
Related Code128 Barcode Integration & Generation Information
The following Code128 barcode integration and creation information links relate to this product that may be of interest to you: