Answered Generating a QR Barcode

RelaX!

New Member
Hi out there,

Anyone tried to print a self-generated QR code from OpenEdge yet ?

Kind regards,
Marcel
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
There are 2D barcode add-ins for Microsoft Word; I think some are free. If you have Word available on your client machine and can print the document from Word via COM automation then that can be done via ABL.
 

jongpau

Member
I did it in OE 10 with the "ThoughtWorks QR Code Library". The code is very simple really (you need at least OE 10 because of the use of .Net):
Code:
USING ThoughtWorks.QRCode.Codec.*.
USING System.Drawing.*.

DEFINE VARIABLE oEncoder AS ThoughtWorks.QRCode.Codec.QRCodeEncoder NO-UNDO.
DEFINE VARIABLE oImage  AS System.Drawing.Image  NO-UNDO.

oEncoder = NEW QRCodeEncoder().
oEncoder:QRCodeVersion = 0.
oImage = oEncoder:Encode("Hello World!").
DELETE OBJECT oEncoder.
oImage:Save("c:\hello_world.gif",System.Drawing.Imaging.ImageFormat:Gif).
 

Attachments

  • hello_world.gif
    hello_world.gif
    1.5 KB · Views: 20

Abigail Klinton

New Member
HI there
Although i have never tried to print a self-generated QR code from OpenEdge yet,i have generate some QR code using a barcode generater.
You can also google for a tool to help you out.That would be more convenient.
 

balta

Member
I did it in OE 10 with the "ThoughtWorks QR Code Library". The code is very simple really (you need at least OE 10 because of the use of .Net):
Code:
USING ThoughtWorks.QRCode.Codec.*.
USING System.Drawing.*.

DEFINE VARIABLE oEncoder AS ThoughtWorks.QRCode.Codec.QRCodeEncoder NO-UNDO.
DEFINE VARIABLE oImage  AS System.Drawing.Image  NO-UNDO.

oEncoder = NEW QRCodeEncoder().
oEncoder:QRCodeVersion = 0.
oImage = oEncoder:Encode("Hello World!").
DELETE OBJECT oEncoder.
oImage:Save("c:\hello_world.gif",System.Drawing.Imaging.ImageFormat:Gif).

I have this error.

upload_2015-1-12_9-22-11.png

What i am doing wrong?
 

Cringer

ProgressTalk.com Moderator
Staff member
A quick KB search on the error number shows the error in question:
Invalid datatype specified: <.NET type name>. Specify a datatype such as 'character' or the name of a class. (5638)
** <program> Could not understand line <number>. (196)
 

Cringer

ProgressTalk.com Moderator
Staff member
My first question would be is the assembly referenced in assemblies.xml?
 

joey.jeremiah

ProgressTalk Moderator
Staff member
You may want to try the free docxfactory project.

Comes with built-in support for practically every 1d and 2d barcodes.

It's compatible with progress version 9 or upwards and will also work on unix/linux.

screenshot_barcode1.png
 

erickroco9611

New Member
I did it in OE 10 with the "ThoughtWorks QR Code Library". The code is very simple really (you need at least OE 10 because of the use of .Net):
Code:
USING ThoughtWorks.QRCode.Codec.*.
USING System.Drawing.*.

DEFINE VARIABLE oEncoder AS ThoughtWorks.QRCode.Codec.QRCodeEncoder NO-UNDO.
DEFINE VARIABLE oImage  AS System.Drawing.Image  NO-UNDO.

oEncoder = NEW QRCodeEncoder().
oEncoder:QRCodeVersion = 0.
oImage = oEncoder:Encode("Hello World!").
DELETE OBJECT oEncoder.
oImage:Save("c:\hello_world.gif",System.Drawing.Imaging.ImageFormat:Gif).


Should it works in OE10.01A? How should I prepare the propath?
 

jongpau

Member
Should it works in OE10.01A? How should I prepare the propath?

I would not be able to tell you if it works on that OE version (its is too old and I have no access to test with it) We have not used anything but 10.2 for a long time now (and we are about to migrate to 11).

Theoretically you should not have to do anything to your propath, what is important is that you make sure that the ThoughtWorks QR code assembly is referenced in the assemblies.xml and that you distribute the assemblies.xml file and the dll file with your software once you get from development to deployment. If your assemblies.xml file is not located in your application startup directory you will have to set the path to the directory that contains it in the pf file of your application

Our assemblies.xml file and the ThoughtWorks.QRCode dll file are both located in the startup directory of the application.

In my assemblies.xml we use:
Code:
<assembly name="ThoughtWorks.QRCode, Version=1.0.2774.19990, Culture=neutral"/>

OpenEdge ships with a little utility called ProAsmRef.exe which helps manage your assemblies.xml. This utility should be located in the bin directory of your OpenEdge installation. I suggest you see if you can find that and use it to do the above so you reference the correct version etc
 

Cecil

19+ years progress programming and still learning.
Just to add more work to your plate. As an alternative you could use phantom.js and and a bit of javascript you can generate a QR code to file in an assortment of image file types. This is a cross OS platform if you are interesting using on Linux as well-as Windows.
 
Top