Class BarcodeObject
Represents a barcode object. Represents a barcode object.
Implements
Inherited Members
Namespace: FastReport.Barcode
Assembly: FastReport.Base.dll
Syntax
public class BarcodeObject : ReportComponentBase, IDisposable, IFRSerializable
Remarks
The instance of this class represents a barcode. Here are some common actions that can be performed with this object:
- To select the type of barcode, use the Barcode property.
- To specify a static barcode data, use the Text property. You also may use the DataColumn or Expression properties to specify dynamic value for a barcode.
- To set a barcode orientation, use the Angle property.
- To specify the size of barcode, set the AutoSize property to true and use the Zoom property to zoom the barcode. If AutoSize property is set to false, you need to specify the size using the Width and Height properties.
Examples
This example shows how to configure the BarcodeObject to display PDF417 barcode.
BarcodeObject barcode;
...
barcode.Barcode = new BarcodePDF417();
(barcode.Barcode as BarcodePDF417).CompactionMode = CompactionMode.Text;
Constructors
BarcodeObject()
Initializes a new instance of the BarcodeObject class with default settings.
Declaration
public BarcodeObject()
Properties
AllowExpressions
Enable or disable of using an expression in Text
Declaration
public bool AllowExpressions { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Angle
Gets or sets the angle of barcode, in degrees.
Declaration
public int Angle { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 |
AsBitmap
Gets or sets values for forced use of a bitmap image instead of a vector
Declaration
public bool AsBitmap { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
AutoSize
Gets or sets a value that determines whether the barcode should handle its width automatically.
Declaration
public bool AutoSize { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
Barcode
Gets or sets the barcode type.
Declaration
public BarcodeBase Barcode { get; set; }
Property Value
Type | Description |
---|---|
BarcodeBase |
Brackets
Gets or sets brackets for using in expressions
Declaration
public string Brackets { get; set; }
Property Value
Type | Description |
---|---|
System.String |
DataColumn
Gets or sets a data column name bound to this control.
Declaration
public string DataColumn { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
Value must be in the form "Datasource.Column".
Expression
Gets or sets an expression that contains the barcode data.
Declaration
public string Expression { get; set; }
Property Value
Type | Description |
---|---|
System.String |
HideIfNoData
Gets or sets a value that determines whether it is necessary to hide the object if the barcode data is empty.
Declaration
public bool HideIfNoData { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
HorzAlign
Gets or sets the horizontal alignment of a Barcode object.
Declaration
public BarcodeObject.Alignment HorzAlign { get; set; }
Property Value
Type | Description |
---|---|
BarcodeObject.Alignment |
NoDataText
Gets or sets the text that will be displayed if the barcode data is empty.
Declaration
public string NoDataText { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Padding
Gets or sets padding within the BarcodeObject.
Declaration
public Padding Padding { get; set; }
Property Value
Type | Description |
---|---|
Padding |
ShowMarker
Gets or sets values for hiding or showing barcode markers
Declaration
public bool ShowMarker { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
ShowText
Gets or sets a value that indicates if the barcode should display a human-readable text.
Declaration
public bool ShowText { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
SymbologyName
Gets or sets the symbology name.
Declaration
public string SymbologyName { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Remarks
The following symbology names are supported:
- "2/5 Interleaved"
- "2/5 Industrial"
- "2/5 Matrix"
- "Codabar"
- "Code128"
- "Code39"
- "Code39 Extended"
- "Code93"
- "Code93 Extended"
- "EAN8"
- "EAN13"
- "MSI"
- "PostNet"
- "UPC-A"
- "UPC-E0"
- "UPC-E1"
- "Supplement 2"
- "Supplement 5"
- "PDF417"
- "Datamatrix"
- "QRCode"
Examples
barcode.SymbologyName = "PDF417";
(barcode.Barcode as BarcodePDF417).CompactionMode = CompactionMode.Text;
Text
Gets or sets the barcode data.
Declaration
public string Text { get; set; }
Property Value
Type | Description |
---|---|
System.String |
Zoom
Gets or sets a zoom of the barcode.
Declaration
public float Zoom { get; set; }
Property Value
Type | Description |
---|---|
System.Single |
Methods
Assign(Base)
Declaration
public override void Assign(Base source)
Parameters
Type | Name | Description |
---|---|---|
Base | source |
Overrides
CreateSwissQR(QRSwissParameters)
Initialize current BarcodeObject as Swiss QR.
Declaration
public void CreateSwissQR(QRSwissParameters parameters)
Parameters
Type | Name | Description |
---|---|---|
QRSwissParameters | parameters | Parameters of swiss qr. |
Draw(FRPaintEventArgs)
Declaration
public override void Draw(FRPaintEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
FRPaintEventArgs | e |
Overrides
GetData()
Declaration
public override void GetData()
Overrides
GetDataAsync(CancellationToken)
Declaration
public override async Task GetDataAsync(CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task |
Overrides
GetExpressions()
Declaration
public override string[] GetExpressions()
Returns
Type | Description |
---|---|
System.String[] |
Overrides
RelocateAlign()
Relocate BarcodeObject based on alignment
Declaration
public void RelocateAlign()
RestoreState()
Declaration
public override void RestoreState()
Overrides
SaveState()
Declaration
public override void SaveState()
Overrides
Serialize(FRWriter)
Declaration
public override void Serialize(FRWriter writer)
Parameters
Type | Name | Description |
---|---|---|
FRWriter | writer |
Overrides
UpdateAutoSize()
Declaration
public void UpdateAutoSize()