QRCode created by ActiveReports6 cannot decode by some decode website

Posted by: snow.wang on 24 March 2020, 5:44 pm EST

  • Posted 24 March 2020, 5:44 pm EST

    Hi

    I'm a developer who uses the ActiveReports component to create a QR Code.
    The version of the ActiveReports component is 6.
    And for some strings, the QR Code cannot be decode by some websites.
    And I found it just happened on my computer (business computer).
    My environment is VS2017 Enterprise, Windows 10 Enterprise (64-bit).
    By debugging the code, my default encoding is iso-8859-1 (CodePage 1252).
    The setting of QR Code like below:

    private DataDynamics.ActiveReports.Barcode qrPayment;
    this.qrPayment = new DataDynamics.ActiveReports.Barcode();

    this.qrPayment.Height = 2.071F;
    this.qrPayment.Left = 0.2099998F;
    this.qrPayment.Name = "qrPayment";
    this.qrPayment.Style = DataDynamics.ActiveReports.BarCodeStyle.QRCode;
    this.qrPayment.Top = 1.042F;
    this.qrPayment.Width = 2.071F;
    this.qrPayment.Text = "SPC\r\n0200\r\n1\r\nCH7608387000001080035\r\nS\r\nING BELGIUM\r\nBank street House 1 Bank district\r\n\r\n9988\r\nGENEVE\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n274.64\r\nCHF\r\nS\r\nA R Kuhn AG\r\nBenzenschwilerstrasse 3 \r\n\r\n5634\r\nMerenschwand\r\nCH\r\nNON\r\n\r\ngezogene Einheiten/Kippauflieger Invoice From 04.03.2020 To 04.03.2020\r\nEPD\r\n\r\n";

    So I confused if there any set of encoding should I change to make the QR Code can decode correct by the website.
    Decode website like below:
    https://zxing.org/w/decode.jspx

    And I upload two QC Code images, the v8 can decode correctly and v6 cannot.
    Please help me how can I do to solve this problem besides upgrading the component.
    If it necessary I can upload my solution.
    Thank you.

  • Replied 24 March 2020, 6:27 pm EST

    Hello,

    Please note that AR6 is out of development mode now and we don't support it. I suggest you to upgrade to our latest version i.e AR14. For more information, you can refer the following link:
    https://www.grapecity.com/activereports
    https://www.grapecity.com/activereports/docs/v14/online/overview.html

    Also, you can download the trial version of AR14 from the following link:
    https://www.grapecity.com/download/activereports

    Also, AR6 is not compatible with VS2017 and Windows10.

    For AR6, You can try after changing the Encoding to "EncodingCodePage=65001"

    Thanks,
    Mohit
  • Replied 24 March 2020, 7:42 pm EST

    Hello Mohitg,

    First, thank you for your reply.
    Of course, upgrade the component can solve this issue. However, it will recode the current solution and take great risks.
    So what I ask is:
    1. How to change the encoding? Like below?
    string str = "SPC\r\n0200\r\n1\r\nCH7608387000001080035\r\nS\r\nING BELGIUM\r\nBank street House 1 Bank district\r\n\r\n9988\r\nGENEVE\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n274.64\r\nCHF\r\nS\r\nA R Kuhn AG\r\nBenzenschwilerstrasse 3 \r\n\r\n5634\r\nMerenschwand\r\nCH\r\nNON\r\n\r\ngezogene Einheiten/Kippauflieger Invoice From 04.03.2020 To 04.03.2020\r\nEPD\r\n\r\n";
    UTF8Encoding myEncoding = new UTF8Encoding();
    byte[] bytes = Encoding.UTF8.GetBytes(str);
    string decodeStr = myEncoding.GetString(bytes);
    qrPayment.Text = decodeStr;
    2. Because I already try this solution and it didn't work. So could I determine that this is a bug of ActiveReports 6 and let our team to agree upgrade the component?

    Thank you.
  • Replied 24 March 2020, 8:45 pm EST

    Hello,

    I have different output at my end. Please refer to the attached PDF. I have used the following line of code:
     this.qrPayment.Height = 2.071F;
    this.qrPayment.Left = 0.2099998F;
    this.qrPayment.Name = "qrPayment";
    this.qrPayment.Style =GrapeCity.ActiveReports.SectionReportModel.BarCodeStyle.QRCode;
    this.qrPayment.Top = 1.042F;
    this.qrPayment.Width = 2.071F;
    this.qrPayment.QRCode.EncodingCodePage = 65001;
    this.qrPayment.Text = "SPC\r\n0200\r\n1\r\nCH7608387000001080035\r\nS\r\nING BELGIUM\r\nBank street House 1 Bank district\r\n\r\n9988\r\nGENEVE\r\nCH\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n274.64\r\nCHF\r\nS\r\nA R Kuhn AG\r\nBenzenschwilerstrasse 3 \r\n\r\n5634\r\nMerenschwand\r\nCH\r\nNON\r\n\r\ngezogene Einheiten/Kippauflieger Invoice From 04.03.2020 To 04.03.2020\r\nEPD\r\n\r\n";


    Thanks,
    Mohit
    test.zip
  • Replied 25 March 2020, 1:01 am EST

    Hi Mohitg,

    I download the pdf, the QR Code in it can decode correctly.
    But this part of your code.
    .qrPayment.QRCode.EncodingCodePage = 65001;

    There didn't exist such attribute EncodingCodePage of QRCode. And my ActiveReports Version is 6.2.3164.0
    I upload my PFD File. And the QRCode in it cannot decode correctly.

    example.zip
  • Replied 25 March 2020, 7:14 pm EST

    Hello,

    Could you please try with the following line of code:
    barcode.QRCode.Encoding = Encoding.UTF8

    Thanks,
    Mohit
  • Replied 25 March 2020, 10:59 pm EST

    Hi Mohit,

    I checked my component version is 6.2.3164.0, and not exist such an attribute.
    But I download a new version 6.3.4797.0 and set Encoding = Encoding.UTF8.
    But It doesn't work. Just on my business computer.
    It is too weird. Seem the QR Code created by this component depends on the environment. Some systems cannot create the QR Code correctly.
  • Replied 26 March 2020, 5:30 pm EST

    Hello,

    Could you please try with the latest version on your system. Share if the issue is also reproducible with the latest version on your system.

    You can download the trial from the following link:
    https://www.grapecity.com/download/activereports

    If the issue is also reproducible with the latest version, please share the environment detail with us like(OS Locale, OS Version)

    Thanks,
    Mohit
Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels