Barcode User Function Library for Crystal Reports
How to Install
The installation guide and setup files are available here.
UFL DLL - Properties and Methods
BarcodeSetLongProp
Sets the value of a numeric property of the barcode generator.
Syntax
- Basic syntax: Function BarcodeSetLongProp(name As String, val As Number) As Number
Parameters:
- name - Name of the property.
- val - The value to assign to the property.
Return value
- Returns 0 on success.
- Error codes.
Examples
Choosing a barcode type:
BarcodeSetLongProp ("Alphabet", 5) ' 5 = CODE128
Encoding data in UTF-8:
BarcodeSetLongProp ("CodePage", 65001)
Remarks
The following properties can be modified through the BarcodeSetLongProp (UFL DLL shares the property names with the ActiveX):
- Alphabet
- CodePage
- ProcessTilde
- QrECL
- QrMinVersion
- NWRatio
- AztecMinLayers
- DataMatrixMinSize
- AztecECL
- PDF417Cols
- PDF417Rows
- PDF417ErrLevel
- Code11CheckDigits
- Transparent
- Rotation
- CompactPDF417
- PDF417ModuleAspectRatio
- PDF417HorzQuietZone
- PDF417VertQuietZone
- FontAntialiasing
- TextJustify
- FontSize
- FontColor
- BkgndColor
- HBorderSize
- VBorderPercent
- ShowText
- ISBN10
- ITF14BearerBox
- ITF14BearerWidth
- QuietZone2D
- CodabarHasCheckDigit
- Code39HasCheckDigit
- ECI
- SaCount
- SaPos
- SaID
BarcodeSetTextProp
Sets the value of a text property.
Syntax
- Basic syntax: Function BarcodeSetTextProp (name As String, val As String) As Number
Parameters:
- name - Name of the property.
- val - The value to assign to the property.
Return value
- Returns 0 on success.
- Error codes.
Examples
Encoding a text string in the barcode:
BarcodeSetTextProp("Text", "ABCDE3457")
Modifying the text below the barcode:
BarcodeSetTextProp ("TextBelow", "Some text")
Remarks
The list of properties that can be modified through the BarcodeSetTextProp (UFL DLL shares the property names with the ActiveX):
BarcodePicture
The function creates a WMF picture file in the system temporary folder.
Syntax
- Basic syntax: Function BarcodePicture (w As Number, h As Number) As String
Parameters:
- w - the desired image width in TWIPs (1440 per inch).
- h - the desired image height in TWIPs (1440 per inch).
Return value
- Returns full path to the barcode picture file on success.
Example
BarcodeSetLongProp ("Alphabet", 25) ' 25 = QR Code
BarcodeSetTextProp ("Text", "123ABC")
formula = BarcodePicture(1440, 1440) ' an 1x1 inch barcode picture
BarcodePicture2
The function creates a monochrome BMP picture file in the system temporary folder.
Use this function instead of the BarcodePicture in late versions of Crystal Reports - they have a EMF/WMF printing bug(?).
Syntax
- Basic syntax: Function BarcodePicture2 (modw As Number, ratio As Number) As String
Parameters:
- modw - The desired single module width in pixels.
- ratio - The desired width:height ratio. The parameter is ignored when creating QR Code, Data Matrix, AZTEC.
Return value
- Returns full path to the barcode picture file on success.
Examples
BarcodeSetLongProp ("Alphabet", 25) ' 25 = QR Code
BarcodeSetTextProp ("Text", "123ABC")
formula = BarcodePicture2(5, 1) ' A QR Code with 5x5 pixel modules.
BarcodeSetLongProp ("Alphabet", 5) ' 5 = CODE 128
formula = BarcodePicture2(2, 3) ' A CODE 128 with 2 pixel wide modules and with width:height ratio of 3:1.
BarcodeSetLongProp ("Alphabet", 6) ' 6 = PDF417
formula = BarcodePicture2(1, 0.5) ' A tall PDF417 with 1 pixel wide modules.
BarcodeGetErrorCode
Retrieves the last error code.
Syntax
- Basic syntax: Function BarcodeGetErrorCode() As Number
Return value
- Returns 0 on success.
- Error codes.
Examples
Paste this expression into a formula field:
formula = BarcodeGetErrorCode ()
© 2025 StrokeScribe. All rights reserved. Use of any portion of this site constitutes acceptance of our Terms of Use and Privacy Policy. The website material may not be reproduced, except with the prior written permission.