Reviving old tech — put QR code on oracle report 6i

Priawan Harjunanto
3 min readMay 18, 2019

--

Request to improve existing services can be mind boggling 😵, last year i got a request to implement QR code on the oracle report 6i — A piece of ancient technology that have been abandoned for years, one which the support is only from the official product documentation or from some obscure user group forum dated back 10 years ago that no one will be answering your question, because no body is using it anymore.

Implementing bar code and QR code in oracle report can be done using several ways :

  • by using bar code font, you need to install compatible bar code font for your desired bar code encoding and then change the font of your data field where you want your data displayed using bar code. This method is simple but it’s only work for bar code not QR code and only for simple encoding like code39 or code128 and the barcode generates sometimes doesn’t print right.
  • still using bar code font but instead of changing the font directly, you call a pl/sql function to transform text on your data field into bar code or QR code, produce better output but require separate pl/sql package and font which is … ehem … not free

Unfortunately both method doesn’t work for report 6i 😩

And then i was stumbled upon some post on some user group forum about inserting dynamic images into reports 💡 how about if i generate the image outside report using python maybe and then load it on the fly. OK here is what i have been doing to achieve that :

  • connect using python to the original data source
  • generate qr code using string from database

it will generate QR code for each data from the database

qr code generated
bunch of qr code on the output folder

Now let’s put it on use by inserting the QR code into matching record on the report, the report it self will be 30.000 ish pages long (600.000 ish in real production environment) and the QR code will goes to each page according to the key code — which is the string below the code.

  • lets open the report on to report 6i builder
  • Insert a new field in to the report
  • Change the properties of ‘Read from file’ to ‘Yes’ and ‘File format’ to ‘image’
  • Edit the definition of calculated formula field using pl/sql editor
  • Preview your brand new report

Enjoy 😉

your sophisticated report printed using line matrix printer

--

--

Priawan Harjunanto
Priawan Harjunanto

Written by Priawan Harjunanto

Outsourced Oracle DBA at BKAD Kab Bantul, Freelance Developer at ByTechnology