How to dynamically load and print a JPEG image (QR-Bill) in a Report?

Hello everyone,Twenty years ago, I built an application using Clarion 6 that manages a taxi company for elderly citizens who need transport for medical appointments. The app is still running perfectly today. It handles client bookings, schedules trip routes, assigns drivers, calculates driver pay, and generates monthly invoices with a detailed trip breakdown.As you may know, Switzerland now requires Swiss Standard QR-bills (QR-codes) for invoices. I need to update my application to print this QR-code on the invoices.Currently, an external Python script successfully generates the QR-code as a JPEG file, naming it with the invoice number (e.g., 12345.jpg).Here is my issue: I need to dynamically load and print this JPEG file inside the Clarion 6 Report writer based on the current invoice number. If I hardcode/embed a static JPEG through the designer, it prints fine. However, I cannot get it to change dynamically at runtime. I am certain there is a way to achieve this.Note: I do own a Clarion 12 license, but I prefer not to migrate this legacy application right now since it works perfectly as it is.Could anyone guide me on how to do this? I would highly appreciate specific examples showing exactly which commands to use and in which Embed points to place them.Thank you in advance for your help!Hello everyone,

Twenty years ago, I built an application using Clarion 6 that manages a taxi company for elderly citizens who need transport for medical appointments. The app is still running perfectly today. It handles client bookings, schedules trip routes, assigns drivers, calculates driver pay, and generates monthly invoices with a detailed trip breakdown.

As you may know, Switzerland now requires Swiss Standard QR-bills (QR-codes) for invoices. I need to update my application to print this QR-code on the invoices.

Currently, an external Python script successfully generates the QR-code as a JPEG file, naming it with the invoice number (e.g., 12345.jpg).

Here is my issue: I need to dynamically load and print this JPEG file inside the Clarion 6 Report writer based on the current invoice number. If I hardcode/embed a static JPEG through the designer, it prints fine. However, I cannot get it to change dynamically at runtime. I am certain there is a way to achieve this.

Note: I do own a Clarion 12 license, but I prefer not to migrate this legacy application right now since it works perfectly as it is.

Could anyone guide me on how to do this? I would highly appreciate specific examples showing exactly which commands to use and in which Embed points to place them.

Thank you in advance for your help!

I’m sure there is an example app which shows how to print a jpg/bmp/gif for the background and a report that shows an image per record, like a flower database of sorts. Not in front of C6 at the moment.

If you generated and compiled all the example apps that ship with clarion, then search the example app folder and sub folders for each example app, for “jpg” and/or “bmp” and other picture files you should find the clw’s with the code and then very quickly identify the example app that will help you do what you want.

Is the QR code jpg/png/bmp file going to be the same name or a unique filename?

ABC or Clarion template chain?

Oh, thank you so much for the prompt reply! I spent 6 hours in front of my PC today looking for a solution.I actually just managed to find a Clarion 6 example app that uses the ABC template chain, which matches my setup. It demonstrates how to print inventory items alongside their respective product images.I’m calling it a night for now, but tomorrow morning I will dive deep into that example to see how it handles the dynamic loading.Thank you again for your help and for pointing me in the right direction!Oh, thank you so much for the prompt reply! I spent 6 hours in front of my PC today looking for a solution.

I actually just managed to find a Clarion 6 example app that uses the ABC template chain, which matches my setup. It demonstrates how to print inventory items alongside their respective product images.

I’m calling it a night for now, but tomorrow morning I will dive deep into that example to see how it handles the dynamic loading.

Thank you again for your help and for pointing me in the right direction!

You would have an IMAGE Control on the Report Detail Band with no file name (or a sample file to get positioned) e.g.

IMAGE,AT(...),USE(?InvoiceQR)

Before you PRINT one Detail you can set the Image file name with PROP:Text something like below. The RTL loads the disk file into the Image.

Report$ ?InvoiceQR{Prop:Text}='QRs\Invoice' & Inv:Number & '.jpg'

They should all be the same size, but sometimes it takes some code to dynamically size and position.

I made the changes you suggested and ran a print test—it works beautifully!

The issue was that I was placing this code:
Report$?Image1{PROP:TEXT} = 'invoice1234.jpg'
in the wrong embed point. Now everything is running perfectly.

Thank you so much for your invaluable help!

Best regards,
Silvano Crivelli