How to Generate UPC-A in RDLC Reports
UPC-A, also known GTIN-12, GS1-12, UCC-12 barcode Symbology, is one of the data carriers that are endorsed by GS1 standard. It is widely used to encode 12 digits of GTIN in point-of-sale systems. UPC-A could be attached with a MOD10 check digit.
Barcode Generator for RDLC provides the complete guideline for UPC-A barcode generation in local client report / RDLC and complex barcode know-how is not required. It also supports UPC-A supplement 2-digit barcode and UPC-A supplement 5-digit barcode creation.
With UPC-A .NET SDK Generator for RDLC, users are entitled to resize barcode by modifying parameters relating to height, width, X-dimension, wide/narrow ratio, margins. It is a visual barcode designer which helps you build powerful report solution using Visual Studio 2005, 2008 and 2010 programs.
This page specifies the complete information for UPC-A generation by using .NET control for RDLC. You are free to use full control over every aspects of UPC-A symbology creation such as valid characteristics, barcode property customization, Human readable text, checksum digit etc.
UPC-A Barcode Generation in Local Reports / RDLC
Encodable Characters |
Able to encode: - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
|
Supplementary Barcode |
UPC-A supplement 2-digit barcode and UPC-A supplement 5-digit barcode could be applied to encode detailed information. |
Development Environments |
Build powerful report resolution in Report Definition Language Client-Side / RDLC Reports. |
Check Digit Option |
Check digit could be calculated automatically and be appended or disabled in the encoded data. |
Image Formats Option |
Create and save barcode images in PNG, BMP, GIF, JPEG, TIFF formats. |
Orientation Option |
Barcode could be printed in a specific orientation such as 0, 90, 180 and 270 degrees to the feed direction of the web or sheet. |
Requirement of UPC-A Barcode Generator for RDLC
Windows Operating Systems
- Microsoft Windows 7 - Windows Server 2008 - Windows Vista - Windows Server 2003 - Windows XP
|
Development Environments
-.NET Framework 2.0, 3.0, 3.5, 4.0 - C#, VB.NET, Managed C++, Borland Delphi for.NET - Visual Studio 2005/2008/2010 -Microsoft SQL Server 2005, 2008 or 2010
|
Add Generation DLL to RDLC Project Reference
- Download Barcode Generator for RDLC Free Trial and unzip it;
- Open Visual Studio, and create ASP.NET web form project;
- Add Barcode Generator DLL to the project reference;
- In Solution Explorer, right-click the "add new items" to add a class;
- Copy the C# or VB.NET sample code in the created class "APP_Code/Class1.cs";
Create UPC-A barcode image RDLC Report Project
- Select "Build" to "build web site";
- In Solution Explorer, right-click the "add new items" to add a report;
- Go to "Report Items" in toolbox to drag and drop a Table into the Report;
- Switch to the "Website Data Source" to add "Name" and "Price" into the report table details section; and drag an image in the last column "Barcode";
- Select the image and navigate the properties to set data source "database", set image MIMEType "image/jpeg" and set value "=Fields!Bit.Value";
- Switch back to Solution Explorer, right-click "Default.aspx" and select "View Designer"
- Drag a "ReportViewer" in Data of toolbox to the project;
- Choose your created report "Report.rdlc" from "Choose Report" menu;
- Debug the webpage, generated barcodes appear in your report.
Create Barcode Images Using C# & VB Sample Codes Below in RDLC Report Project
Run the report, barcode images will be showed on the web page.
using System;
using System.Collections.Generic;
using BusinessRefinery.Barcode;
using BusinessRefinery.Barcode.RDLC;
public class Product
{
private string m_name;
private int m_price;
private byte[] m_bit;
public Product(string name, int price, string data)
{
m_name = name;
m_price = price;
Linear barcode = new Linear();
barcode.Symbology = Symbology.UPCA;
barcode.Code = data;
m_bit = barcode.drawBarcodeAsBytes();
}
public byte[] Bit
{
get { return m_bit; }
}
public string Name
{
get
{
return m_name;
}
}
public int Price
{
get
{
return m_price;
}
}
}
public class Merchant
{
private List<Product> m_products;
public Merchant()
{
m_products = new List<Product>();
m_products.Add(new Product("00123456789", 25, "00123456789"));
m_products.Add(new Product("01234567890", 30, "01234567890"));
m_products.Add(new Product("12345678900", 15, "12345678900"));
}
public List<Product> GetProducts()
{
return m_products;
}
}
Imports System.Collections.Generic
Imports BusinessRefinery.Barcode
Imports BusinessRefinery.Barcode.RDLC
Public Class Product
Private m_name As String
Private m_price As Integer
Private m_bit As Byte()
Public Sub New(name As String, price As Integer, data As String)
m_name = name
m_price = price
Dim barcode As New Linear()
barcode.Symbology = Symbology.UPCA;
barcode.Code = data
m_bit = barcode.drawBarcodeAsBytes()
m_bit = barcode.drawBarcodeAsBytes()
End Sub
Public ReadOnly Property Bit() As Byte()
Get
Return m_bit
End Get
End Property
Public ReadOnly Property Name() As String
Get
Return m_name
End Get
End Property
Public ReadOnly Property Price() As Integer
Get
Return m_price
End Get
End Property
End Class
Public Class Merchant
Private m_products As List(Of Product)
Public Sub New()
m_products = New List(Of Product)()
m_products.Add(New Product("00123456789", 25, "00123456789"))
m_products.Add(New Product("01234567890", 30, "01234567890"))
m_products.Add(New Product("12345678900", 15, "12345678900"))
End Sub
Public Function GetProducts() As List(Of Product)
Return m_products
End Function
End Class