Unplanned
Last Updated: 21 Oct 2021 14:14 by ADMIN
Mark
Created on: 12 Oct 2021 15:14
Type: Bug Report
1
Telerik Reporting Data Matrix cannot encode unprintable characters

Our manufacturing floor needs to have unprintable characters encoded in the data matrix in our reports, so that our plant controllers can receive instructions.  The characters I'm speaking about are things like the Record Separator (ASCII 1E), Group Separator (ASCII 1D), and End of Transmission (ASCII 4).  

 

3 comments
ADMIN
Dimitar
Posted on: 21 Oct 2021 14:14

Hello Mark,

Thank you for the provided code sample.

With this data, I have been able to reproduce the issue. As a result of that, we have decided to approve this bug report as valid and have set the status of the item to Unplanned.

Thank you for the cooperation!

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Mark
Posted on: 18 Oct 2021 16:23

A lot of it can be found in support ticket 1538448, but here is the code that build the problematic string that the barcode couldnt encode into a data matrix: 

 

     private static string Generate2dBarcodeCodeString(List<List<string>> FieldLabelsAndData)
        {

            //assemble the unprintable characters that serve as formatting and record separation. 

            StringBuilder sb = new StringBuilder();
            char rs = (char)0x1E;
            char us = (char)0x1F;
            char gs = (char)0x1D;
            char eot = (char)0x04;


            //assemble the header strings and the recurring strings for formatting. 
            string messageHeader = $"[)>{rs}";
            string formatHeader = $"07{gs}";
            string subDataField01 = "BV";
            string subFieldSeperator = $"{us}";
            string barcodeVersion = "WO.2.0.0";
            string formatTrailer = $"{rs}";
            string messageTrailer = $"{eot}";

            List<string> barcodeFormatAndInformationStrings = new List<string>
            {
                messageHeader,  $"06{gs}", subDataField01, subFieldSeperator, barcodeVersion, formatTrailer
            };

            barcodeFormatAndInformationStrings.ForEach(s => sb.Append(s));

            // assemble the field labels, fields, and open and closing of each section. 
            foreach (var fieldSet in FieldLabelsAndData)
            {
                sb.Append(formatHeader);

                for (int i = 0; i < fieldSet.Count; i++)
                {
                    sb.Append(fieldSet[i]);
                    if (i != FieldLabelsAndData.Count - 1)
                    {
                        sb.Append(subFieldSeperator);
                    }
                }

                sb.Append(formatTrailer);
            }

            sb.Append(messageTrailer);

            return sb.ToString();
        }
    }

 

 

The method above was called with the following input:

 

new List<List<string>> 
            {
                new List<string>{"ts1 ", "test1 ", "ts2 ", "test2 " }
                , new List<string>{"ts3 ", "test3 ", "ts4 ", "test4 " }
            });
 

And it produced a sizing error when the resulting data matrix's value was set to the output string:

ADMIN
Dimitar
Posted on: 18 Oct 2021 13:36

Hello Mark,

Thank you for the bug report.

Could you please send us some of the data that you have tested and reproduced the issue with?

We are looking only for the data with unprintable characters.

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.