Adding a QR Code to Crystal Reports

Sadly, this no longer works. Google have removed the API. I’m hoping that the next release of Crystal Reports supports https for image locations so I can update this to a newer API.

I just had an interesting support question from a customer, and felt the need to put pen to paper.

They’re finding that regular barcodes are getting too long, so want to switch to using QR Codes for their ID badges. They use Crystal Reports to print the IDs, so need a solution for Crystal Reports. While a User Function Library (UFL) could be used, they’d prefer to avoid the extra work involved in installing the UFL on the PCs and Enterprise Server.

So, the best (only?) option is to use a Web Service and conditionally format an image in Crystal to show the correct QR code.

If you want to do things the hard way, head over to https://google-developers.appspot.com/ and look at the chart API. If you want to do it the easy way, just do this:

  1. First head over to ZXing
  2. Define your base QR Code. It’s easier to edit this later with any custom information in Crystal Reports
  3. Create your Crystal Report
  4. Insert any old image, and make it slightly larger than you want the QR code to appear.
  5. Right click the image and select ‘Format Graphic’
  6. Select the Picture Tab
  7. Click the ‘Custom Format’ (x+2) button next to Graphic Location
  8. Paste in the URL you created in Step 2, put quotation marks around it so that it’s interpreted as a string
  9. Click OK
  10. You now have a static QR code in your report.
  11. Modify the URL you created in 8 so that the QR Code becomes dynamic and includes the information you need.
  12. If you’re having problems, chances are you’ve missed the http:// from the start of the url. Sadly, https isn’t supported.

I must admit, I didn’t realise just how flexible QR codes were until I started this. I’m really impressed!

Download the sample report.

One thought on “Adding a QR Code to Crystal Reports

  1. I am using Crystal Reports XI, please can you guide me how I can generate dynamic QR codes from data queried from Sql Server database.

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top