Recent

Author Topic: [SOLVED] Lazreport. Multiple printers  (Read 558 times)

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
[SOLVED] Lazreport. Multiple printers
« on: December 11, 2025, 11:34:21 am »
Hi All.

In lazreport, you can set the specific printer when you create the report, but I have an interesting challenge.
The user have a Report Printer, Label Printer and a Receipt Printer.
The App's settings load these upon startup, and the types & brands of printers may vary from user to user.

I need to tell LAZ report before it prepare the report to use the Label printer or Receipt printer. If I allow the use the Preview and change the printers it may have undesirable outcomes.

I have tried Printer.setprinter(Mysettings. receiptprinter) before I open the report but that has no effect.
I need to use my settings to set the printer based on the user's setup.

I will appreciate your help as always.

Regards,

Peter
« Last Edit: December 12, 2025, 09:24:09 am by Petrus Vorster »

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
Re: Lazreport. Multiple printers
« Reply #1 on: December 11, 2025, 11:54:34 am »
No, Lazreport wont do in this instance.
It generates a picking list for a mail operator to physically check mailboxes, but the list is sometimes 6000 entries long.

The preview is immediate, but the print takes AGES.

I also need to create page breaks after every 100 entries.


Perhaps I will just make a manual print job.

-Peter

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Lazreport. Multiple printers
« Reply #2 on: December 11, 2025, 01:43:58 pm »
Code: Pascal  [Select][+][-]
  1.   frReport1.LoadFromFile('sample.lrf');
  2.   if frReport1.ChangePrinter(0, cbprinter.ItemIndex) then  //you must specify the printer index in the system; the default printer is 0
  3.   begin
  4.     if frReport1.PrepareReport then
  5.       frReport1.PrintPreparedReport('', 1); //or: frReport1.ShowPreparedReport; for preview
  6.   end;
Best regards / Pozdrawiam
paweld

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
Re: Lazreport. Multiple printers
« Reply #3 on: December 11, 2025, 02:32:53 pm »
That is what I was looking for!

The Receipt printer seem to mess the LAZREPORT around.
It uses one long page, and the preview shows one long page, but output to the printer shows it preparing hundreds of pages, and it takes about 8 minutes before it starts to print.

That instance I think i need to use my direct printing and cut the paper after every 100 boxes.

Thank you for all your patience and help.

-Peter

paweld

  • Hero Member
  • *****
  • Posts: 1561
Re: Lazreport. Multiple printers
« Reply #4 on: December 11, 2025, 03:12:47 pm »
Without the code, it's difficult to advise or help.
If you can, create an example showing the problem and share it.
Best regards / Pozdrawiam
paweld

Petrus Vorster

  • Full Member
  • ***
  • Posts: 220
Re: [SOLVED] Lazreport. Multiple printers
« Reply #5 on: December 12, 2025, 09:27:32 am »
Hi Paweld

The number of mailboxes makes one receipt printout a disaster.
I nearly depleted a whole receipt roll using a branch with many mailboxes.

I am going to create some code first where the user can select different sections in groups of 100, then make an output to the receipt printer. That should resolve that issue.

-Thank you, all your other examples works like a charm.

-Peter

 

TinyPortal © 2005-2018