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:
- Obtain existing or compile the two QRCoder assemblies with strong names and the PartiallyTrustedCallers attribute
- Install the two assemblies to the global assembly cache (GAC) using the gacutil.exe utility
- Create a new SSRS report that queries a table of test data
- Add a reference to the QRCoderImageToByteArray GAC assembly
- Add a custom code function that sends a string to the QRCoderImageToByteArray assembly and accepts a byte array in return
- Add a field to the report and increase the physical dimensions of the field to accomodate a larger QR code symbol
- Drag-and-drop an image componenet to the new field to bring up the image properties dialogue
- Change the image source to Database, add a function that references the custom code function and change the MIME type to image/png
- Set the size property of the image component to fill the available field space while maintaining the original aspect ratio
- 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:
And use that code as source for image component: