Generate QR Code® barcodes in an SSRS report with the QRCoder library

  • Stan Kulp-439977

    SSCrazy Eights

    Points: 9948

    Comments posted to this topic are about the item Generate QR Code® barcodes in an SSRS report with the QRCoder library

  • Robert Sterbal-482516

    SSCrazy

    Points: 2785

    Thanks for posting this!

    My favorite resource for QR Codes is: 

    https://www.nayuki.io/page/qr-code-generator-library

  • Neodynamic

    Mr or Mrs. 500

    Points: 598

    Great article about inserting QR Codes in SSRS reports. One problem with that approach is the need to install the dll into the system GAC. You can avoid that by registering the dll in the Visual Studio RSPreviewPolicy.config file with an entry similar to this one:

    <CodeGroup class="UnionCodeGroup" version="1" PermissionSetName="FullTrust" Name="MyQRCode" Description="This code group grants FullTrust to MyQRCode assembly.">  <IMembershipCondition class="StrongNameMembershipCondition" version="1" PublicKeyBlob="000000............0000000" /></CodeGroup>

    The PublicKeyBlob for your dll assembly can be obtained in this way 

    Then that same entry must be added to the SSRS rssrvpolicy.config file
    These settings should rid off the need of registering the dll into the GAC.
    For more advanced barcode options as well as another 2D types like DataMatrix, DotCode, PDF417, etc and for a visual barcode CRI you might try other alternatives like BP for SSRS

    HTH

    Tools for SSRS, ASP.NET & PHP
    Barcode CRI for SSRS[/url]

  • Stan Kulp-439977

    SSCrazy Eights

    Points: 9948

    Robert Sterbal-482516 - Monday, October 22, 2018 4:51 AM

    Thanks for posting this!

    My favorite resource for QR Codes is: 

    https://www.nayuki.io/page/qr-code-generator-library

    Unfortunately it doesn't appear that they have a C# version.

  • smohammadmir

    Newbie

    Points: 5

    hi
    Thanks for posting this,
    But Be careful friends dlls in "StronglyNamedPartiallyTrustedCallersDLLs" Folder deploy on ssrs>2014
    "Error while loading code module: ‘QRCoderImageToByteArray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3016ec4525f0585e’. Details: Could not load file or assembly 'QRCoderImageToByteArray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3016ec4525f0585e' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
    "
    in ssrs<=2014 .NET Framework <=3.5 is supported for Reporting Services assemblies

  • Stan Kulp-439977

    SSCrazy Eights

    Points: 9948

    smohammadmir - Friday, February 8, 2019 4:01 PM

    hi
    Thanks for posting this,
    But Be careful friends dlls in "StronglyNamedPartiallyTrustedCallersDLLs" Folder deploy on ssrs>2014
    "Error while loading code module: ‘QRCoderImageToByteArray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3016ec4525f0585e’. Details: Could not load file or assembly 'QRCoderImageToByteArray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3016ec4525f0585e' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded
    "
    in ssrs<=2014 .NET Framework <=3.5 is supported for Reporting Services assemblies

    That means that you will have to compile the source code yourself. I supplied the source code I used to compile it in the attached resource file.

  • srechner

    Newbie

    Points: 2

    I'm sure I'm doing something wrong, but I cannot get the QRCoderImageToByteArray.dll file.

    I am unable to find the QRCoderResources.zip file, (along with the StronglyNamedPartiallyTrustedCallersDLLs folder). I've tried using the Compile.bat batch file, which did create the QRCoder.dll file, but not QRCoderImageToByteArray.dll.

    Any ideas on how I can resolve this?

  • Edward

    Grasshopper

    Points: 15

    Any luck srechner ? i am in the same boat. i couldnt find QRCoderResources.zip

     

  • srechner

    Newbie

    Points: 2

    Not with this solution. I ended up generating QR codes via https://api.qrserver.com.

  • Stan Kulp-439977

    SSCrazy Eights

    Points: 9948

    SQL Server Central hasn't restored the resource files after the conversion yet.

    I scoured my hard drive and found copies of QRCoder.dll and QRCoderImageToByteArray.dll that I think are the ones I included with the article. I uploaded them to my google drive. Here is the link:

    https://drive.google.com/drive/folders/1T8hJVFhuY61bZbokC7l4SwHx3cJCoL6s?usp=sharing

  • Edward

    Grasshopper

    Points: 15

    Stan Kulp-439977, Thank you very much for your help. i will give it a try

  • Stan Kulp-439977

    SSCrazy Eights

    Points: 9948

    Looks like they just restored the resource file to the article.

    https://www.sqlservercentral.com/wp-content/uploads/2019/04/QRCoderResources.zip

  • Edward

    Grasshopper

    Points: 15

    Brilliant . Thanks for letting us know

  • ArturoBandini

    Grasshopper

    Points: 11

    We are getting the same error...

    Error while loading code module: ‘QRCoderImageToByteArray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3016ec4525f0585e’. Details: Could not load file or assembly 'QRCoderImageToByteArray, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3016ec4525f0585e' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

    How do we correctly compile the source code?

    Thanks for your help!

    • This reply was modified 5 months, 2 weeks ago by  ArturoBandini.

Viewing 14 posts - 1 through 14 (of 14 total)

You must be logged in to reply to this topic. Login to reply