This is a migrated thread and some comments may be shown as answers.

Output equal sign in Telerik Reporting QR Code

8 Answers 456 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Stephen
Top achievements
Rank 1
Stephen asked on 11 Dec 2019, 09:26 AM

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

8 Answers, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 12 Dec 2019, 01:29 PM

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
0
Stephen
Top achievements
Rank 1
answered on 12 Dec 2019, 01:48 PM

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

0
Stephen
Top achievements
Rank 1
answered on 12 Dec 2019, 02:40 PM
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
0
Stephen
Top achievements
Rank 1
answered on 12 Dec 2019, 05:32 PM

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}'))";

0
Neli
Telerik team
answered on 17 Dec 2019, 12:40 PM

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
0
Stephen
Top achievements
Rank 1
answered on 17 Dec 2019, 03:35 PM

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

0
Neli
Telerik team
answered on 20 Dec 2019, 08:14 AM

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
0
Stephen
Top achievements
Rank 1
answered on 20 Dec 2019, 08:28 AM
This has resolve the issue, thanks Neli! :)
Tags
General Discussions
Asked by
Stephen
Top achievements
Rank 1
Answers by
Neli
Telerik team
Stephen
Top achievements
Rank 1
Share this question
or