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.
- 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, Postnet, Data Matrix ECC200, QR-Code, PDF417 and others.
- Included with any Developer License to any of the IDAutomation Barcode
Installation | Tutorial
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
- This SSRS barcode report tutorial uses Code 128 from the
Code 128 Font
- 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.
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:
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.
- 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()
- 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)
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.
product support may be obtained by searching resolved
phone, email and forum support is also provided up to 30 days
after purchase. Additional
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
Site or the
Microsoft SSRS TechNet Forum.