SSRS Barcode Font Encoder
- Easily generate barcodes in SSRS using fonts without any dependencies.
- The font encoder is custom report code that stays embedded in the report when it is distributed.
- 2021 Release adds UTF-8 and Unicode support for Aztec, Data Matrix, PDF417 and QR Code.
- Complete royalty-free source code is included.
- Compatible with SSRS Report Builder 3 and Report Designer from Visual Studio 2008 R2 and up; both RDL and RDLC files.
- Supports generation of Code 128, GS1-128, Code 39, DataBar, ITF, UPC, EAN, USPS IMb, Aztec, Data Matrix ECC200, GS1-DataMatrix, QR-Code, GS1-QRCode, PDF417, and others.
- Included with all Developer Licenses to any of the IDAutomation Barcode Font Packages purchased after April 2021. To obtain this product for previous purchases, the Level 2 Support and Upgrade Subscription must be active or purchased if it is not active.
The files for the Native Generators are located in the "SSRS Font Encoder" folder of the developer licensed zip file. RDL files are also included as an example, which should be referred to if problems are encountered with implementation.
- This SSRS barcode report tutorial uses Code 128 from the Code 128 Font Advantage Package.
- Purchase and install the appropriate barcode fonts by running the setup EXE file provided in the font package.
- Open the custom code section of the report:
- Visual Studio .NET Report Designer users: The font
only be installed into existing reports. Refer to the Creating a
Report tutorial, if there is not an existing report.
Select File - New - Project.
To activate the Report menu in the VS .NET IDE, click on the body of the
report. Select Report - Report Properties - Code.
- Report builder users: Choose File - New - Report and open
the report custom code. If the Report Properties dialog does not appear,
click on the gray area of the report.
- Visual Studio .NET Report Designer users: The font encoder can only be installed into existing reports. Refer to the Creating a Report tutorial, if there is not an existing report. Select File - New - Project. To activate the Report menu in the VS .NET IDE, click on the body of the report. Select Report - Report Properties - Code.
The code area of the report should now appear:
- Open the desired font encoder in a text editor, in this tutorial IDAutomation_SSRS_FontEncoder_Code128.txt is opened.
Copy the contents of the file and Paste the code into the custom
code area and choose OK. This places a custom function in the
report that formats data to the barcode font. Save the report.
- Add a Textbox where the barcode is needed or locate an existing text
field and size it to be large enough to contain the barcode. If
the Textbox is not large enough, the barcode will be very distorted or
order to produce the required quiet zone, or the space around the barcode,
it is recommended to choose the paragraph center options.
- Right-click on the Textbox and select Expression. This is where
the custom code is executed and the resulting barcode will be placed within
the Textbox. In design mode, the expression will appear as «Expr» .
- Set the expression to include the barcode generation formula:
replacing HeroID with the data field that needs to be encoded in the barcode and select needs to be encoded in the barcode and select OK. To obtain the formula for other barcode types, refer to the name of the associated .txt file. Refer to the Barcode Parameters section of this manual for information about encoding multiple fields, different barcode types and appending static text to dynamic data.
- Select the Textbox and set the font to the appropriate barcode font and
point size. The "IDAutomationC128XS" font is selected in this example at 12
- Run the report and verify the barcode is generated properly.
- Setting Barcode
Properties: These may
be set in the =code expression or in the custom code area. These parameters
should only be set when necessary.
- To set a parameter in the =code expression, place a comma after the
field data and enter the value, for example:
- To set a default parameter in the custom code area, open the report
custom code and locate the "Public Function" statement and change the
desired default value.
- To set a parameter in the =code expression, place a comma after the field data and enter the value, for example:
- Data Type Conversions: If the data in the field (HeroID
in this case) is not stored as text it will need to be converted into a
string before encoding, for example: Fields!HeroID.Value().ToString()
- Setting Barcode Properties: These may be set in the =code expression or in the custom code area. These parameters should only be set when necessary.
- Encoding Multiple Fields:
Multiple fields and static text may be combined and encoded in the same
barcode in VBA code format. For example,
=Code.IDAutomation_SSRS_Code128("IDA" & Chr(9) & Fields!HeroID.Value)
Encodes the text IDA, a tab function and the result of the HeroID field. Static text must appear in quotes and all information is concatenated with the ampersand (&) symbol.
- Generating Multiple Barcode Types: If it is necessary to generate multiple barcode types on the same report, copy the function of the other barcode type needed into the code area (step 3 and 4 above) under the function that already exists and update the expression, as in step 7-9 above. Be sure to select the appropriate barcode font for the expression being used.
Free product support may be obtained by searching resolved Public Forum Threads. Priority phone, email and forum support is also provided up to 30 days after purchase. Additional priority phone, email and forum support may be obtained if the Level 2 Support and Upgrade Subscription is active. For assistance with other SSRS issues, refer to Microsoft Support for Business Site or the Microsoft SSRS TechNet Forum.