Recent

Author Topic: How can I print a QR from lazreport  (Read 3309 times)

mandy

  • Newbie
  • Posts: 3
How can I print a QR from lazreport
« on: February 23, 2023, 09:47:00 pm »
I want to make a report generating QR codes for mass printing.
But in LazReport it is only possible with the barcode

paweld

  • Hero Member
  • *****
  • Posts: 1423
Re: How can I print a QR from lazreport
« Reply #1 on: February 23, 2023, 10:12:55 pm »
With LazBarCodes you need to prepare a bitmap with a QR code, and then pass on to the report. 
Tomorrow I will try to prepare an example
Best regards / Pozdrawiam
paweld

dsiders

  • Hero Member
  • *****
  • Posts: 1441
Re: How can I print a QR from lazreport
« Reply #2 on: February 23, 2023, 10:18:35 pm »
I want to make a report generating QR codes for mass printing.
But in LazReport it is only possible with the barcode

Use the forum search. There are previous discussions on the topic, and an attached modification to allow lazreport to use QRCode.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

mandy

  • Newbie
  • Posts: 3
Re: How can I print a QR from lazreport
« Reply #3 on: February 24, 2023, 03:39:00 pm »
This is the code I use to generate the bitmap, I'm not sure if it's correct
Code: Pascal  [Select][+][-]
  1. BarcodeQR1.Text:='Cod: '+Activos.FieldValues['CODACT']+'|Grupo: '+Activos.FieldValues['TIPOACT']+'|Tipo: '+Activos.FieldValues['TIPOACT']+'|Marca: '+Activos.FieldValues['MARCA']+'|Modelo: '+Activos.FieldValues['MODELO']+'|Serie: '+Activos.FieldValues['SERIE']+'|Descripción: '+Activos.FieldValues['DESTIPOACT']+'|Ubicación General: '+Activos.FieldValues['ESTADO'];
  2. BarcodeQR1.Generate;
  3. BarcodeQR1.SaveToFile('qrcode.bmp', nil, 300, 300);

paweld

  • Hero Member
  • *****
  • Posts: 1423
Re: How can I print a QR from lazreport
« Reply #4 on: February 24, 2023, 09:26:09 pm »
Sample in attachment

Edit 2025-03-03: added test.lrf (report definition) file
« Last Edit: March 03, 2025, 06:10:39 pm by paweld »
Best regards / Pozdrawiam
paweld

moonshadow

  • Newbie
  • Posts: 2
Re: How can I print a QR from lazreport
« Reply #5 on: March 03, 2025, 04:39:17 pm »
Could you please upload the "test.lrf" file.
When running the program, it indicates that this file is missing, which should be the report from lazreport where the codes are displayed.
It would be a great help for me to understand how the program you shared with us works.
Thanks in advance

paweld

  • Hero Member
  • *****
  • Posts: 1423
Re: How can I print a QR from lazreport
« Reply #6 on: March 03, 2025, 06:13:21 pm »
Hi @moonshadow,
sorry, I forgot to add the lrf extension to the exceptions when publishing the project. I've edited that post, but I'm attaching the missing report here as well.
Best regards / Pozdrawiam
paweld

moonshadow

  • Newbie
  • Posts: 2
Re: How can I print a QR from lazreport
« Reply #7 on: March 04, 2025, 09:22:03 pm »
Thank you very very much!

 

TinyPortal © 2005-2018