How do I show a qr code in SSRS?

Douglas Acosta picture Douglas Acosta · Apr 23, 2016 · Viewed 9k times · Source

I am in the quest to build a report in ssrs/report builder that contains a qr code, is it possible to achieve this?

I was thinking in implementing a class using c#/vb.net that codes any url/mail address into a QR Code and then import that code into the report to use it.

What would be your advice?

Answer

Vladislav picture Vladislav · Dec 18, 2018

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

These are the steps required to create an SSRS report that displays QR code symbols using the QRCoder library:

  1. Obtain existing or compile the two QRCoder assemblies with strong names and the PartiallyTrustedCallers attribute
  2. Install the two assemblies to the global assembly cache (GAC) using the gacutil.exe utility
  3. Create a new SSRS report that queries a table of test data
  4. Add a reference to the QRCoderImageToByteArray GAC assembly
  5. Add a custom code function that sends a string to the QRCoderImageToByteArray assembly and accepts a byte array in return
  6. Add a field to the report and increase the physical dimensions of the field to accomodate a larger QR code symbol
  7. Drag-and-drop an image componenet to the new field to bring up the image properties dialogue
  8. Change the image source to Database, add a function that references the custom code function and change the MIME type to image/png
  9. Set the size property of the image component to fill the available field space while maintaining the original aspect ratio
  10. Execute the report to display the data and the QR code generated from the data

This solution based on QRCoder.

The main points are to register assemblies in GAC, write code calling these assemblies from the report: custom report function

And use that code as source for image component: using component as image source