Unplanned
Last Updated: 08 May 2020 17:43 by ADMIN
Nileshkumar
Created on: 01 Mar 2019 12:49
Category: Barcode
Type: Bug Report
1
An error occurred while parsing EntityName is thrown when a special char is used in the barcode text
 

Using an ampersand character in RadBarcode's Text leads to a server-side error. Replacing the symbol with its corresponding HTML entity allows the control to render its text successfully, but the generated image corresponds to the passed entity character.

If RadBarcode1.Text="&" the control generates this (read as "&"):
https://www.screencast.com/t/NuOVjB8EY

while it should be this (read as "&"):
https://www.screencast.com/t/vOhWkUoW

Workaround:

When we generate the image by keeping ShowText = True, then it throws the exception.

When we generate the image by keeping ShowText = false, then it successfully generates the image.

Steps to reproduce:Run the following setup:

ASPX:
        <telerik:RadBarcode ID="RadBarcode1" runat="server" RenderChecksum="false"></telerik:RadBarcode>
CS:
    protected void Page_Load(object sender, EventArgs e)
    {
        RadBarcode1.OutputType = Telerik.Web.UI.BarcodeOutputType.SVG_VML;
        RadBarcode1.Type = Telerik.Web.UI.BarcodeType.Code128;
        RadBarcode1.Text = "string&string"; //leads to server-side error
        //RadBarcode1.Text = "string&amp;string"; //leads to wrongly generated barcode

        RadBarcode1.LineWidth = 0;
        RadBarcode1.ShowText = true;
        RadBarcode1.ShowChecksum = false;
        RadBarcode1.GetImage();
    }

0 comments