1. hadi raad
  2. PowerBuilder
  3. Thursday, 1 November 2018 12:53 PM UTC

Dear Appeon Team  

 
I am trying to add Q-R code in Data window (report ) that has been designed in power builder 10.5 version
and I can’t find the correct way to add it .
is there any way to add Q-R code as component in report

please advise   

Attachments (1)
Miguel Leeuwe Accepted Answer Pending Moderation
  1. Wednesday, 27 October 2021 16:13 PM UTC
  2. PowerBuilder
  3. # 1

You could use a picture control in your datawindow and assign an QR image file to it.

 

Edit: only works on pb2019 and higher:

I just finished uploading a sample app to encode text to an image on disk and then decode the image back to text: https://community.appeon.com/index.php/qna/q-a/third-party-dll-reading-in-appeon

 

Comment
  1. Miguel Leeuwe
  2. Friday, 29 October 2021 13:38 PM UTC
Try something like this first. The last parameter being 0 might be what makes it invisible:



// external function declaration:

Function long ShellExecute( long hwnd, string lpOperation, string lpFile, string lpParameters, string lpDirectory, integer nShowCmd) Library "shell32.dll" alias for "ShellExecuteW"



// pb script

setnull(ls_null)

ll_handle = Handle(Parent)// setnull(ll_handle)



// gnv_app.is_appdir is the path to my application, don't know how important it is, just check. You can also try "ls_null" which I see a lot of people doing:

ShellExecute( ll_handle, 'Open', "your command", ls_null, gnv_app.is_appDir, 0) // last parameter: 1=Normal (last used winState), 3=maximized, 0=hidden????

  1. Helpful 1
  1. Miguel Leeuwe
  2. Friday, 29 October 2021 16:36 PM UTC
Sorry for the delay, but I've been at war with GIT. In visual studio it's a breeze, but with PB ...

So here's the latest version of the PB sample app: https://github.com/mjl38/PB_sample_app_QRCodes

And here's the latest version of my Vstudio .net library (and test window form): https://github.com/mjl38/QRCodes

Let me know if you would like me to zip it all and duplicate it on the several posts here.

(For now I'm deleting them, since I have several versions duplicated in 3 different Q&A's).

regards.
  1. Helpful 1
  1. Orlando Barreaux
  2. Friday, 29 October 2021 19:09 PM UTC
thank you, I gonna prove it and then I'll tell you if I could do it



best regards
  1. Helpful
There are no comments made yet.
Orlando Barreaux Accepted Answer Pending Moderation
  1. Wednesday, 27 October 2021 15:59 PM UTC
  2. PowerBuilder
  3. # 2

Hi everyone,

 

I hope that anyone can help me with this QR code issue, I use a 3rd party component in power builder classic in onder to show

a QR code with a font, the problem is that this is a too old QR code and a simple web QR reader can't read it, only native apps can.

is there any other way to render a simple standard QR? any of you have developed something similar before in PB classic?

 

any suggestion is welcome.

thanks

Comment
There are no comments made yet.
Marco Meoni Accepted Answer Pending Moderation
  1. Wednesday, 16 September 2020 07:27 AM UTC
  2. PowerBuilder
  3. # 3

Hi Hadi (and everybody),

you don't need any DLL to generate QR.

And, it isn't true that "Appeon doesn't support QR".

Just use HTTPclient object (or even the old iNet object since you are still with PB 10.5) and get the QR picture out of Google API.

For example, a good "PowerBuilder rocks!" 230x230 pixel QR: :-)

http://chart.apis.google.com/chart?cht=qr&chs=230x230&chof=gif&&chl=PowerBuilder rocks!&choe=UTF-8&

Have a look at Google Chart API for list of URL parameters.

Best,

.m

 

Comment
  1. Miguel Leeuwe
  2. Monday, 1 November 2021 23:20 PM UTC
True, good point! ... but then you need an internet connection and permissions. Also, I think that if you have a lot of imaging / decoding to do, a local DLL would be way faster, plus you don't depend on Google's next down time.

just my 2cts.
  1. Helpful
There are no comments made yet.
Michal Kulakovsky Accepted Answer Pending Moderation
  1. Tuesday, 15 September 2020 22:58 PM UTC
  2. PowerBuilder
  3. # 4

It is very sad, that Appeon doesn't support Barcodes/QR codes as new control/object  in DataWindow.
I'm using for years, generating barcode to bitmap file on disk and than function bitmap([path]) in datawindow.
You can choose

for QR code free quricol32.dll library https://github.com/perevoznyk/quricol

or if you want complex barcode solution QR code and other barcodes .... https://zint.github.io/ which is also free.

I voted for barcodes support in every discussion about new features with Appeon, but it looks like no one from important customers use barcodes ....

 

Comment
  1. Olan Knight
  2. Sunday, 1 May 2022 01:48 AM UTC
Michael -

Have you used this QURICOL32.DLL in PowerBuilder to successfully create QR codes?

Can you please share how to make this happen as I'm a complete novice with QR codes.



Thanks,

Olan
  1. Helpful
  1. Michal Kulakovsky
  2. Sunday, 1 May 2022 07:52 AM UTC
For instance

Declare in Global External Functions



// QR codes

subroutine GenerateBMPA( ref string fileName, ref string text, integer margin, integer size, integer ErrorCorrectionLevel ) library 'quricol32.dll' Alias For "GenerateBMPA;Ansi"

subroutine GeneratePNGA( ref string fileName, ref string text, integer margin, integer size, integer ErrorCorrectionLevel ) library 'quricol32.dll' Alias For "GeneratePNGA;Ansi"



Next create function ...



global type f_qr_code_2_file from function_object

end type



forward prototypes

global function boolean f_qr_code_2_file (string afilename, string atext)

end prototypes



global function boolean f_qr_code_2_file (string afilename, string atext);



// best quality

If FileExists(aFileName) Then

If Not FileDelete(aFileName) Then Return False

End If

GeneratePNGA( aFileName , aText, 1, 1, 3 )

// 1 = 87x87 px

// 4 = 348x348 px

// 5 = 435x435 px

// 10= 230x230 px

Return FileExists(aFileName)

end function



In next step I wrapped this function with another one for instance

string f_generate_qr_code( string atext)

this function generate unique filename somewhere through function above and returns this unique filename with path.



To use it in datawindow

Compute column ....

Expression ...

bitmap( f_generate_qr_code( datawindow_column) )



And that's all.



Notice at the end. You should take care about QR codes files. They will be grow up ...



HTH

MK
  1. Helpful 1
There are no comments made yet.
John Purugganan Accepted Answer Pending Moderation
  1. Friday, 11 September 2020 10:47 AM UTC
  2. PowerBuilder
  3. # 5

Would any of the QR Code solutions work within an Appeon website?

Is there an Appeon solution to reading QR code, as well?

 

Thank you.

John 

Comment
There are no comments made yet.
Juan Alejandro Lam López Accepted Answer Pending Moderation
  1. Tuesday, 13 November 2018 23:05 PM UTC
  2. PowerBuilder
  3. # 6

I sent you an example of code in Appeon Powerbuilder 17 R3, you can use it and replicate it in any version.

Attachments (1)
Comment
  1. Sivaprakash BKR
  2. Wednesday, 14 November 2018 14:17 PM UTC
I tried your tool.... following errors.



Could only register UnityEngine.dll

While trying to register itextsharp.dll [ Manually ], Warning: RA0000: No types were registered error is coming

zen.barcode.core.dll is not found

facturador.dll - says it's not a valid .net assembly.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Monday, 12 November 2018 20:01 PM UTC
  2. PowerBuilder
  3. # 7

If the DataWindow object is a text control called t_qrcode:

dw_1.object.t_qrcode.text = ls_qrcode

 

 

Comment
There are no comments made yet.
hadi raad Accepted Answer Pending Moderation
  1. Sunday, 11 November 2018 13:24 PM UTC
  2. PowerBuilder
  3. # 8

Dear Brad 
i have already installed the font and the encoder that you provide in the post 
i appropriate the code in the example you mention
but i really need to know where to use the code because in the data windows that i work on i cant edit the back code of element as text control 
please if you can provide me with the pb library of the example you made 

so much thanks

Comment
  1. Brad Mettee
  2. Sunday, 11 November 2018 14:18 PM UTC
Hadi,

The code we use is for Barcode 128, and it's an embedded part of a report system.



We created a dummy column in the select statement from the database, and at runtime, we populated that field with the barcode data so it can be used on each individual row of the report. The basic logic is that after the retrieve, we loop through each row and compute the barcode value for the dummy field from other field values (we're encoding several different types of reference numbers), then use setitem to plug the value into the column. The report can then be viewed/printed and the appropriate barcode shows for each row.
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Wednesday, 7 November 2018 00:21 AM UTC
  2. PowerBuilder
  3. # 9

On a very slightly similar topic, I have a dll & sample of how to print the US Postal Service address barcodes.

http://www.topwizprogramming.com/freecode_usps4cb.html

 

Comment
There are no comments made yet.
Brad Mettee Accepted Answer Pending Moderation
  1. Tuesday, 6 November 2018 18:50 PM UTC
  2. PowerBuilder
  3. # 10

I created a full new reply so I could do a proper code sample.

We've been using IDAutomation's universal barcode generator for 10+ years now. They have a version for QR codes as well.

ID Automation QR Code Font

I haven't looked at pricing recently, there are several tiers to choose from

Once installed (font and data encoder), here's sample code to generate the text the font uses to produce a QRCode. Text field (static text or db column) will need to be tall enough to fit the entire QRCode.

 

oleobject ole_qrcodegen
ole_qrcodegen = create oleobject
long ll_status

ll_status = ole_qrcodegen.ConnectToNewObject("IDAuto.QRCode")
if ll_status = 0 then
    string ls_result, ls_str2encode
    ls_result = space(8192)
    int ProcessTilde, EncodingMode = 0, ECL = 0, Ver = 0
    ls_str2encode = "now is the time"
    ole_qrcodegen.FontEncode(ls_str2encode, ProcessTilde, EncodingMode, ECL, Ver, ref ls_result)
    ole_qrcodegen.disconnectobject()
end if

 

 

The text in ls_result can be put into a text field in a DW to show a QR Code, providing it's font is set properly. 

Comment
There are no comments made yet.
hadi raad Accepted Answer Pending Moderation
  1. Sunday, 4 November 2018 11:09 AM UTC
  2. PowerBuilder
  3. # 11

Dear Roland 

Thanks for your reply , it is not really what i am looking for .

when i use q-code as font it is only convert the type of font 

i need to use Q-R code as encoding way so i can use the mobile camera to decode the Q-RCode Square 

 

thanks 

Comment
  1. Brad Mettee
  2. Sunday, 4 November 2018 13:09 PM UTC
Hadi,

What you are saying doesn't quite make sense. You either need to generate a QR code for display/printing, or you need to scan one and decode it for processing. There's a huge difference between the two.



To encode a QR code, you'll need an appropriate font, as indicated by Roland, and an encoder dll or activex control to turn your data string into the right characters for the font to make up the code itself. After you encode your data, you place it into a text/field object on a datawindow that's set to use the QR code font.



To decode a QR code, you'll need a DLL or ActiveX object that can access the scanning device (a hand held camera based scanner, or a built in camera).



If you describe what you actually need, we may be able to point you in a better direction.



  1. Helpful
  1. hadi raad
  2. Tuesday, 6 November 2018 08:32 AM UTC
Dear Brad

I am trying to generate and encode QR code in my data windows report in power builder

i tried the QR font that exists the internet and it doesn't work ...

and i used the Dll encoder (Qrmaker.OCX) and register it but when i try to insert the QR-maker control it show that message ( insertion of ole object failed license file required )

and i found anther way to do that but in window (exe ) in power builder and i need to use it in data window ( report)

if you had the right way to do what you mention in your second section of your comment

please advice



so much thanks for you
  1. Helpful
There are no comments made yet.
Roland Smith Accepted Answer Pending Moderation
  1. Thursday, 1 November 2018 13:15 PM UTC
  2. PowerBuilder
  3. # 12

You should be able to do it using a special QR code font.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.
We use cookies which are necessary for the proper functioning of our websites. We also use cookies to analyze our traffic, improve your experience and provide social media features. If you continue to use this site, you consent to our use of cookies.