New to Telerik Reporting? Download free 30-day trial

Getting Started with the Barcode Report Item

This guide shows how to create and use the Telerik Reporting Barcode report item in reports.

  • First, you will specify the type of the Barcode report item, configure its settings, and encode its value.
  • Then, you will set the width of the Barcode elements and elaborate on the appearance of the report item.

At the end, you will be able to achieve the following result.

var encoder = new Telerik.Reporting.Barcodes.Code128AEncoder();

// Set any specific encoder settings...
encoder.ShowText = false; // The default value is true.

this.barcode1.Encoder = encoder;
this.barcode1.Angle = 90;
this.barcode1.BarAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left;
this.barcode1.Checksum = true;
this.barcode1.Module = Telerik.Reporting.Drawing.Unit.Point(3);
this.barcode1.Stretch = false;
this.barcode1.Value = "1234567890";
Dim encoder = New Telerik.Reporting.Barcodes.Code128AEncoder()

' Set any specific encoder settings...
encoder.ShowText = False 'The default value is True

Me.barcode1.Encoder = encoder
Me.barcode1.Angle = 90
Me.barcode1.BarAlign = Telerik.Reporting.Drawing.HorizontalAlign.Left
Me.barcode1.Checksum = True
Me.barcode1.Module = Telerik.Reporting.Drawing.Unit.Point(3)
Me.barcode1.Stretch = False
Me.barcode1.Value = "1234567890"

Specifying the Barcode

  1. To specify the type of the Barcode, use the Encoder property. After setting the desired encoder, you can further adjust the specific settings you require.

    barcode-encoder-property

  2. Now, you need to encode the Barcode value through the Value property. Value can be a static string or an expression which is evaluated at runtime.

    barcode-value-property

Setting the Size and Appearance

  1. You can now specify the width (size) of the Barcode elements. To set the Barcode size, use either of the following approaches:

    • Use the Module property.

    • Automatically calculate the width from the size of the item when the Stretch property is set to true.

    barcode-module-stretch-property

  2. Align the bars to the edges of the item through the BarAlign property.

    Note that BarAlign is not applicable when the Stretch property is set to true.

    barcode-baralign-property

  3. Rotate the Barcode through the Angle property.

    Note that when the angle is not divisible by 90 degrees and the Stretch property is true, the Barcode will be scaled down so that it fits into the item bounds.

    barcode-angle-property

  4. Include a checksum in the Barcode by using the Checksum property.

    Note that some symbologies either do not provide a checksum or the checksum is part of the symbology specification. In these cases, Checksum will have no effect.

See Also

In this article