0

"PrintAllRecord" --- Button for printing several records in one pdf

Hi, 

I'm looking for the formula to print several records of a child table in one pdf .   "PrintAllRecord" doesn't work. Example : 

for i in select ChildTableName do
printAllRecord(i, "FormName")
end

Thanks for your help 

6replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • have you tried printRecord(i,"formname")

    Like
  • Thanks for you answer. PrintRecord only print one record :-( 

    Like
    • rqe3bc
    • rqe3bc
    • 1 yr ago
    • Reported - view

    I'm still having this problem as well (since 2020 lol).  I've also tried other solutions in the forum that also only show one record instead of all records.  Is this a bug on the iPad Ninox?  It's been driving me crazy....

    Like
    • Sebastian
    • FES Minden
    • Sebastian.1
    • 10 mths ago
    • Reported - view

    As far as I know there is no option for this :( Hope I'm wrong though!

    Like
  • So the following button script works - cos I already use it!

    I've renamed parts to make it clearer for you

    ChildTableName - needs to be the name of your child table

    PrintName needs to be the name of your print layout

     

    I use MyPrint (which is a yes/no flag so when set to 1 (it is yes) - you don't have to have this, but i have it to stop me issuing the same invoice twice!)

    let a := (select ChildTableName where myPrint = 1); 
    for myVar in slice(a, 0, 20) do
    printRecord(myVar, "PrintName");
    myVar.(myPrint := 0)
    end

    Note the 20 in the slice arguments is a batch control ie - I print out 20 off at a time then issue them.

    The beauty here is that if you use the control flag (myPrint) and set your table view to sort the view on this flag then the table will show you where you got to and then the next press of the button will resume from that point.

    This will produce separate download pdf's for each record (ie invoices)

    You could also use it in conjunction with sendEmail and a template letter to auto send via Email (works great for me with over 1500 documents to get out in a batch)

    Mel

    Like
    • Sebastian
    • FES Minden
    • Sebastian.1
    • 10 mths ago
    • Reported - view

    Thank you Mel, it does work! However, the solution is not ideal. Do you know if there is a way...

    1) to first select a folder where all the PDFs are stored? Preview opens me a bunch of PDFs which I have to manually save somewhere.
    2) to give each PDF a specific name (not just table+Id, but for example the name of the client).

    Like
Like Follow
  • 10 mths agoLast active
  • 6Replies
  • 533Views