Output equal sign in Telerik Reporting QR Code

9 posts, 0 answers
  1. Stephen
    Stephen avatar
    6 posts
    Member since:
    Feb 2018

    Posted 11 Dec 2019 Link to this post

    On the latest Telerik Reporting Designer when adding a QR Code I cannot seem to include the equals sign (=) as part of the value. A sample of the value I need to output is "=ABCD123" but this doesn't appear to be valid. I've tried to encode it, surround it in quotes and escape it with a backslash but no matter where in the text it is it always strips out the special characters. 

    Is there any way to include the equal sign at the beginning of a literal text value in a QR Code?

     

    Thanks

  2. Neli
    Admin
    Neli avatar
    252 posts

    Posted 12 Dec 2019 Link to this post

    Hello Stephen,

    You may use the approach applied in the attached report:

    - Put the value of the Barcode in a datasource (for example CSV DataSource). 

    - Assign the datasource to the report;

    - Set the Value of the barcode to be: =Fields.FieldsName (in this case = Fields.Value)

    Another option is to put the barcode in a List whose DataSource will be the CSV.

    Regards,
    Neli
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Stephen
    Stephen avatar
    6 posts
    Member since:
    Feb 2018

    Posted 12 Dec 2019 in reply to Neli Link to this post

    How would this be achieved in C#?

    Presently I just do this:
    var barcode = (Telerik.Reporting.Barcode)barcodeBaseItem

    barcode.Value = "=ABC123";

    As it is a website I really don't want to have to write to an external CSV just to set the value of a string property

    Thanks

  4. Stephen
    Stephen avatar
    6 posts
    Member since:
    Feb 2018

    Posted 12 Dec 2019 in reply to Stephen Link to this post

    Is there not a way to escape the character or output the string literal? Seems like a bit of an oversight where all special characters (that are valid) are stripped out
  5. Stephen
    Stephen avatar
    6 posts
    Member since:
    Feb 2018

    Posted 12 Dec 2019 Link to this post

    In the Report Designer setting the barcode value to "= HtmlDecode(HtmlEncode('=XPHH2***'))" outputs the "=" sign. However doing the same thing in C# still strips out the special character:

    barcode.Value = $"= HtmlDecode(HtmlEncode('{encryptedValue}'))";

  6. Neli
    Admin
    Neli avatar
    252 posts

    Posted 17 Dec 2019 Link to this post

    Hi Stephen,

    You can try to avoid this effect by using the following approach:

    this.barcode1.Encoder = code128Encoder1;
    this.barcode1.Location = new Telerik.Reporting.Drawing.PointU(Telerik.Reporting.Drawing.Unit.Inch(1.4D), Telerik.Reporting.Drawing.Unit.Inch(0.2D));
    this.barcode1.Name = "barcode1";
    this.barcode1.Size = new Telerik.Reporting.Drawing.SizeU(Telerik.Reporting.Drawing.Unit.Inch(3.5D), Telerik.Reporting.Drawing.Unit.Inch(2.85D));
    this.barcode1.Value = "= (\"=CE662WTJ\")";
    

    You can check the attached cs report which demonstrates the solution.

    Regards,
    Neli
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  7. Stephen
    Stephen avatar
    6 posts
    Member since:
    Feb 2018

    Posted 17 Dec 2019 Link to this post

    Thanks Neli. This appears to still strip out the "=". I've tried both on the template (preview) and on a printed document and the QR code only shows "CE662WTJ"

    Regards

  8. Neli
    Admin
    Neli avatar
    252 posts

    Posted 20 Dec 2019 Link to this post

    Hi Stephen,

    To escape the equal sign in the Standalone designer, you can use the expression below:

    = ("=CE662WTJ")

    The approach is applied in the attached report.

    Regards,
    Neli
    Progress Telerik

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  9. Stephen
    Stephen avatar
    6 posts
    Member since:
    Feb 2018

    Posted 20 Dec 2019 Link to this post

    This has resolve the issue, thanks Neli! :)
Back to Top