Printing delivery note

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

cbarbal
Posts: 114
Joined: Fri May 08, 2015 5:04 pm

Printing delivery note

Post by cbarbal » Mon Sep 03, 2018 12:37 pm

Hi,

Because FileMaker is not interested in clients with 5 sets, I've looked at LiveCode again. I hope that all the rest is understood, it is Google translation.

The main problem I have with LiveCode is the printing of any report, delivery note or invoice that may have more than one page. I have not found any example or input that explains it, I do not say that they do not exist.

The following could be correct?

Create a print card with the measurements of an A4, with a dataGrid for the lines. In the same stack, or substack?

Use ceiling function to know print pages. Total records / Visible records of the dataGrid

Open Printing. Make a loop and load the first n visible records, break
the n seconds, break

until you reach the rest of the records. Close Printing

I'm on the right track or there's a better one. I enclose a jpg with a delivery note as I do in FileMaker.

Thanks in advance,

Carles
Attachments
Sin título.jpg

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Printing delivery note

Post by Klaus » Mon Sep 03, 2018 12:45 pm

Hi Charles,

welcome to the forum!

You are correct, this is the way to go:
Load all visible lines into a datagrid, print, repeat until all "records" of the complete data have been printed.


Best

Klaus

cbarbal
Posts: 114
Joined: Fri May 08, 2015 5:04 pm

Re: Printing delivery note

Post by cbarbal » Mon Sep 03, 2018 2:38 pm

Hello Klaus,

Thanks for your reply. Abusing confidence, it is better to have the printing cards in the same stack or in a subStack.

I do not dominate the LiveCode very much, I've only pretended to replicate what I do in FileMaker.

You have a nice day,

Carles

Klaus
Posts: 13806
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Printing delivery note

Post by Klaus » Mon Sep 03, 2018 2:47 pm

Hi Carles (sorry for the extra H in my first reply),
cbarbal wrote:
Mon Sep 03, 2018 2:38 pm
Abusing confidence, it is better to have the printing cards in the same stack or in a subStack.
that really does not matter!
But be sure to GO to that stack before printing, even if invisible:

Code: Select all

...
go invisible stack "your print stack here"
## Do your printing
close stack "your print stack here"
...
Datagrids sometimes behave a little "strange" if you don't. 8)


Best

Klaus

cbarbal
Posts: 114
Joined: Fri May 08, 2015 5:04 pm

Re: Printing delivery note

Post by cbarbal » Mon Sep 03, 2018 2:57 pm

Hi Klaus,

It does not matter the H, it is the same name in French. Thanks for the advice to go to the stack, I want it to be invisible so that the client does not see it

Regards,

Carles

TerryL
Posts: 78
Joined: Sat Nov 23, 2013 8:57 pm

Re: Printing delivery note

Post by TerryL » Thu Sep 06, 2018 6:33 pm

Hi cbarbal. An alternative to paper invoicing is PDF invoicing using a simple table field.

Attached is a demo stack. PDF each invoice separately and email to the client for payment saving print & postage costs, or PDF all invoices each week for business records. Scripts for both methods are included. Maybe it will give you some ideas.

A LibreOffice.org spreadsheet can easily do an invoice too. Terry
Attachments
InvoicePDF.zip
InvoicePDF Stack
(2.97 KiB) Downloaded 264 times
Invoice PDF.jpg
Beginner Lab (LiveCode tutorial) and StarterKit (my public stacks)
https://tlittle72.neocities.org/info.html

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Printing delivery note

Post by dunbarx » Thu Sep 06, 2018 7:17 pm

Hypercard had, however old fashioned it seemed, a powerful native report feature, that could accept information in any form, and even use user defined functions, all that to assemble data into a customizable template for printing.

I did mention it appeared old-fashioned.

This sort of comment has come up repeatedly forever. LC could sure use a gadget like that, essentially a table field or DG-like control (maybe a widget?) that could be easily be manipulated and populated.

Now one can easily roll one's own, with graphics and images; that is not the point. LC ought not cause consternation among new users with what appears to be an egregious missing feature.

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing delivery note

Post by bogs » Thu Sep 06, 2018 7:29 pm

dunbarx wrote:
Thu Sep 06, 2018 7:17 pm
Hypercard had, however old fashioned it seemed, a powerful native report feature, that could accept information in any form, and even use user defined functions, all that to assemble data into a customizable template for printing.
Mc and RR had that too, in various styles. Here is the version from RR 2.2.1...
Selection_003.png
RunRev 2.2.1 Report Builder
Image

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9578
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Printing delivery note

Post by dunbarx » Thu Sep 06, 2018 8:34 pm

Bogs.

I know you are LC-old-fashioned, too.

But report builder is no longer around, no?

Craig

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: Printing delivery note

Post by bogs » Thu Sep 06, 2018 9:59 pm

Well, as of 7.1.4 you could still find and use it, although it is in the 'Unsupported' folder. I simply moved it from there to the plugins folder, but we both know how odd I am, and 7.1.4 is a tad new'ish for me to be in a lot :wink:
Selection_004.png
revReportSetup.rev, new install of 7.1.4...
From 8.x up it is obliterated from the landscape as far as I can tell, but I see no real reason it wouldn't work there as much as any older stack works, however you may find yourself having to rewrite portions of it for changes in language possibly.
Image

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Printing delivery note

Post by bangkok » Sat Sep 08, 2018 6:35 am

cbarbal wrote:
Mon Sep 03, 2018 2:38 pm
it is better to have the printing cards in the same stack or in a subStack.
If you're on Windows, do not forget the "formatforprinting" issue.

http://livecode.wikia.com/wiki/FormatForPrinting

So for that matter, it's better to put all your printing stuff in a sub-stack.

cbarbal
Posts: 114
Joined: Fri May 08, 2015 5:04 pm

Re: Printing delivery note

Post by cbarbal » Sat Sep 08, 2018 12:20 pm

Thanks to everyone for the tips,

I have created a substack with the measurements of a A4 portrait, and a script that allows me to print any number of pages you need. I have made a list of Clients in PDF with 51 pages. I have used a dataGrid with 35 lines, without headers. Now I have the issue of putting the headers and the number of pages to each, but it was not the most important.

The issue of printing is one of the things that has slowed me down from FileMaker to LiveCode several times, now I'm giving LiveCode another chance. Per if you have been with FileMaker since version 4, now we are on the 17 and next year on the 18t, you find the printing topic very primitive.

I will also be left with the theme of barcode labels and control of stoks with a code bar reader.

The attached in case it can be useful:

Code: Select all

on mouseUp
   put the dgText of group "dgClientes" into tTemporal
   put the Number Of Lines of tTemporal into tRecords
   put 35 into tLinias -- Rows per page
   
   put 1 into counter
   put tLinias into counter2
   put ceiling(tRecords/tLinias) into tPaginas -- Total Rows
   
   ask file "Guardar PDF como" with "Clientes.pdf"
   if it is empty then exit mouseUp
   go invisible stack "PrintA4V" -- Para imprimir sin que se vea
   
   open printing to PDF it
   
   repeat for tPaginas times
      put line counter to counter2 of tTemporal into tData
      set the dgText of group "dgClientes" of card "PrintClients" of stack "PrintA4V" to tData
      print card "PrintClients" of stack "PrintA4V" into the printRectangle
      if counter2 < tRecords then
         print break
         put (counter + tLinias) into counter
         put (counter2 + tLinias) into counter2
      end if
   end repeat
   
   close printing
end mouseUp
Regards,

Carles

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: Printing delivery note

Post by bangkok » Sat Sep 08, 2018 2:53 pm

cbarbal wrote:
Sat Sep 08, 2018 12:20 pm
I will also be left with the theme of barcode labels and control of stoks with a code bar reader.
What do you mean by that ?

Printing barcode is very straightforward.

-use code39 or code 128 font for instance

-apply this font to a Livecode field, and voilà.

If you want to go further : there is a library for 3D barcode
https://github.com/macMikey/sQuiRt

If you want to use a barcode reader with a LC app... it's a USB device... Livecode can deal with it... it will process data as "keyboard input".

With a little bit of training, soon... you'll forget Filemaker. :D

cbarbal
Posts: 114
Joined: Fri May 08, 2015 5:04 pm

Re: Printing delivery note

Post by cbarbal » Sat Sep 08, 2018 3:19 pm

Hi bangkok,

It can be very simple with LiveCode, but printing labels with a Zebra printer in FileMaker, which are not compatible is not. With a printer technician we spent about 3 hours to configure it, the size of the label that you put on the printer has nothing to do with the FileMaker. I already told the client that they were not compatible, he tried. The Spanish ñ does not understand the printed and puts in its place the n.

It is a program of traceability of the food chain and needs a type of label that is made of plastic and does not run ink with moisture. This will be the next program that I will try to ring with LiveCode, so I do not rush the size of the barcode.

I've only been with LiveCode for a couple of weeks and I do not see that I'm very focused on the management issue, or at least it appears to me. I have never seen any management program on LiveCode and I do not know its real power.

Regards,

Carles

Mikey
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 755
Joined: Fri Jun 27, 2008 9:00 pm

Re: Printing delivery note

Post by Mikey » Sun Sep 09, 2018 3:07 pm

Carles,
Is there no print driver for the printer? We use a variety of barcode printers, both thermal transfer and zebras (which is really just thermal transfer with a laminated top layer). I would have to check with the guys on what they did to make zebra printing work, but I thought they just used used the print driver.

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”