1. mathews rutto
  2. PowerBuilder
  3. Tuesday, 9 June 2020 05:19 AM UTC

Hello,

I want to generate a QR code in a datawindow. I have design a freeform dataobject in form of a report so i want to add QR code at the footer of my report.

How can i achieve this?

Accepted Answer
Marco Meoni Accepted Answer Pending Moderation
  1. Tuesday, 9 June 2020 07:30 AM UTC
  2. PowerBuilder
  3. # Permalink

Hi Mathews,

you can find plenty of 3rd part OLE or NET libraries. Personally, I prefer to go for Google API.

For example,

1) format the URL according to the API, here I want a 230x230 GIF:

http://chart.apis.google.com/chart?cht=qr&chs=230x230&chof=gif&&chl=Hello Google, this is PB 2019 R2&choe=UTF-8&

2) send the request to Google (use PB HttpCient, iNet, etc)

3) receive the response and display the QR blob into a picture control with SetPicture()

Best,

.m

 

Comment
  1. mike S
  2. Tuesday, 9 June 2020 13:56 PM UTC
"example code"

copy the link that he provided and paste it into a browser
  1. Helpful
  1. Marco Meoni
  2. Tuesday, 9 June 2020 20:35 PM UTC
Indeed, the link should be self explanatory.

But if also need an example about how to send the HTTP request and receive the picture, take this one:



https://docs.appeon.com/appeon_online_help/pb2019r2/powerscript_reference/ch10s311.html



(use GetResponseBody(lblb_blob) to download the picture)



Best,

.m

  1. Helpful
  1. mathews rutto
  2. Wednesday, 10 June 2020 05:35 AM UTC
Thank you it has worked,

  1. Helpful
There are no comments made yet.
O E Accepted Answer Pending Moderation
  1. Friday, 12 June 2020 09:12 AM UTC
  2. PowerBuilder
  3. # 1

Hello,

I'm facing the same problem. I'm able to receive the blob from Google-API. I can show the qr-code in a window per picturobject.

Code: p_1.setpicture(lbl_body)

But how to show the qr-code in a datawindow for printing?

Comment
  1. Marco Meoni
  2. Sunday, 14 June 2020 08:25 AM UTC
Hi,

use the Bitmap() function in a computed expression and pass the filename, where you have stored the blob beforehand, as argument.

Best,

.m
  1. Helpful
  1. O E
  2. Monday, 15 June 2020 07:40 AM UTC
Thanks or your reply. I do not have an physical file. I have to the show the blob/picture without saving it as physical file..
  1. Helpful
  1. a s
  2. Wednesday, 22 November 2023 12:34 PM UTC
Did you find a solution to your case??
  1. Helpful
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.