How to encode Carriage Return, Tab, or any ASCII Char using Barcodes Professional for Reporting Services

Technologies used
- Neodynamic Barcode Professional 2.0 (or greater) for Reporting Services
- Microsoft .NET Framework 1.1 or greater
- Microsoft Visual Studio .NET 2003, Microsoft Visual Studio 2005 or SQL Server Business Intelligence Development Studio
- Microsoft SQL Server 2000/2005 Reporting Services or Visual Studio Local Reports RDLC

There are some scenarios where encoding non-printable ASCII characters such us Carriage Return (CR), Horizontal Tab, NL Line feed/new line, etc; becomes a need. By using Barcode Professional into your reports you'll be able to encode all ASCII characters without effort.

IMPORTANT NOTE
You can encode non-printable ASCII characters ONLY if the Barcode Symbology you opt for allows doing that. Please refer to our Barcode Symbology Information Center and verify if the symbology you opt for accepts encoding such characters.


If you are using Reporting Services 2000 or Visual Studio Local Reports RDLC
In these reporting scenarios, you have to instantiate and use Barcode Professional in a VB.NET Function under the Code section of the report. For example, supposing you have the following function in the Code section of your report:

Public Function GetBarcode(ByVal valueToEncode As String) As Byte()
objBarcode.Code = valueToEncode
objBarcode.Symbology = Neodynamic.ReportingServices.Symbology.Code39
objBarcode.Extended = True
objBarcode.BarWidth = 0.01
objBarcode.BarHeight = 0.4
objBarcode.AddChecksum = False
Return objBarcode.GetBarcodeImage()
End Function

Then in order to encode for example a Carriage Return (CR) which Decimal ASCII value is 13, you should use the Chr() function in the Expression that is invoking the GetBarcode function i.e. you should write something like the following:

=Code.GetBarcode(Fields!ProductID.Value & Chr(13) & Fields!ProductName.Value)


http://www.neodynamic.com/Support/FA...ure1_small.png
Example of how to encode a Carriage Return character by using Chr() function in Reporting Services 2000 or Visual Studio Local Reports RDLC

If you are using Reporting Services 2005
In this reporting scenario, the Barcode Professional Report Item is placed on the report surface where you want to display the barcode image. If barcode professional is used as a Report Item, then a few main properties must be specified. Given the previous hypothetical example, if you want to encode a Carriage Return (CR), then you should use the Chr() function in the Expression you specify for the Code property of Barcode Professional (see the following figure).

http://www.neodynamic.com/Support/FA...ure2_small.png
Example of how to encode a Carriage Return character by using Chr() function in Reporting Services 2005

Notice how the Chr() function is specified in the Code property of Barcode Professional and given that Code 39 is used, notice too that the Extended property must be set to True so the Carriage Return character can be encoded by using such Symbology.

Links:
This Demo
More Demos
Download Barcode Professional for Reporting Services
More Information about Neodynamic Barcode Professional for Reporting Services

Neodynamic
.NET Components & Controls
http://www.neodynamic.com
http://www.barcode-for-reporting-services.com