Recent

Author Topic: [Solved]Lazreport Labels  (Read 316 times)

Petrus Vorster

  • Full Member
  • ***
  • Posts: 183
[Solved]Lazreport Labels
« on: December 03, 2025, 09:18:41 am »
Hi all.

I am using Lazreport to print tracking numbers on a receipt printer. Works great.

Now I need to print individual labels to a label printer.
Each label will have a different barcode.

I can set up the label layout & size in lazreport, but I am lost how one would generate multiple labels in a report, each with its own different tracking number.

So, same format, different information on each label.

How would one go about doing that?

Regards,

Peter
« Last Edit: December 04, 2025, 09:43:05 am by Petrus Vorster »

Handoko

  • Hero Member
  • *****
  • Posts: 5505
  • My goal: build my own game engine using Lazarus
Re: Lazreport Labels
« Reply #1 on: December 03, 2025, 10:01:09 am »
I haven't tried but I believe it should work.
Save all the labels' information into a temporary database. Set the lazreport to loop all the records of the database. Remove the temporary database after the printing done.

paweld

  • Hero Member
  • *****
  • Posts: 1515
Best regards / Pozdrawiam
paweld

Petrus Vorster

  • Full Member
  • ***
  • Posts: 183
Re: Lazreport Labels
« Reply #3 on: December 03, 2025, 11:29:25 am »
YES!
The perfect example!!

That is exactly what i was looking for!
Thanks a million.

-Peter

Petrus Vorster

  • Full Member
  • ***
  • Posts: 183
Re: Lazreport Labels
« Reply #4 on: December 03, 2025, 12:03:04 pm »
Ok, i see what you did.

Id i just keep to Code128 I found if I make the label in Lazreport I need to add Master data band, then select FORCE new page.
It will then create a new label for each tracking number in the database.
So far so good.
See image.

These labels are small. 65x20MM.
So it is immensely difficult to place the bands correctly.
On the preview it looks good, the printing totally different. It would scroll like10 labels, or print over the edges etc. Label printers are notoriously problematic.

-Regards, Peter

paweld

  • Hero Member
  • *****
  • Posts: 1515
Re: Lazreport Labels
« Reply #5 on: December 03, 2025, 01:15:53 pm »
Please note that the total height of all bands on the page should not exceed the height of the page. In this case you do not need to force a new page after detail band (provided, of course, that only one item fits on the page).
You can also reduce the font size for the text to make the barcode taller, e.g.
Code: Pascal  [Select][+][-]
  1. barcode.Font.Size := 8;
Best regards / Pozdrawiam
paweld

Petrus Vorster

  • Full Member
  • ***
  • Posts: 183
Re: Lazreport Labels
« Reply #6 on: December 03, 2025, 02:28:33 pm »
@paweld.

I am plying with the sizes, but i am destroying rolls  of expensive labels here with misprints.
 :D >:(
I figured that band size might cause the problem.

I was thinking of perhaps follow that example and output the code to QR to image like you did.
There is another idea that may work, on some of my older programs i printed a little BMP on the label.
I see the QR can be saved to file, which means it can probably be saved to a memory image.
If i can do that, then i can just change the barcode, print the image and repeat without using Lazreport.
I haven't done that yet, and I am not sure how one will generate a number of images in memory and then print them on labels in a row yet.
I am going to study that example of yours first.

-Peter

paweld

  • Hero Member
  • *****
  • Posts: 1515
Re: Lazreport Labels
« Reply #7 on: December 03, 2025, 05:25:37 pm »
So far, I haven't had too many problems with printing on a label printer. The only problem was printing blank pages, which was caused by the page size/bands size on the page being too large (mainly in height) or the label printer not being calibrated.
When checking the size, you should also pay attention to the margins set in the printer properties, as they reduce the size of the label.
I mainly used LazReport to print labels, but I also sometimes used FortesReport version 3.2.4.
For preliminary tests, I always use a PDF printer, for which I define the page size to be equal to the label size.
If you have any problems, try creating a simple demo to illustrate the situation and attach it to your post. If you cannot share it publicly, send it to me in a PM.
Best regards / Pozdrawiam
paweld

Petrus Vorster

  • Full Member
  • ***
  • Posts: 183
Re: Lazreport Labels
« Reply #8 on: December 04, 2025, 09:42:38 am »
Thanks mate.

I am a bit newby on Lazreport. Only recently started it.

I usually create labels with printer.canvas, and now moved to Lazreport since the code128B is easier to print on a receipt roll that way.
Then i thought I could perhaps use that for labels too.

I have zero margins on the label printer, but i have larger labels available too (and more expensive) so I am going to test on that first. Testing on a little Datamax first before i try the big Zebra.
I will start a new thread if i dont get it right.

Thanks - Peter

 

TinyPortal © 2005-2018