0

Button to save a pdf when multiple print layouts are available

Hello,

i have a form and multiple print layouts (that's because from the same data in the form, I need to have many different papers created).

 

1. Is there a way to add different buttons the form (one for each print layout), so that I can save the pdf (or print) without having to click on the printer icon, select the correct print layout and then export the pdf

That would be a huge time saver.

 

2. if point 1 is possibile, would it also be possible to set the path for the saved pdf?

Thank you all.

6 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 1 yr ago
    • Reported - view

    I would suggest to use a choice field, for example 'PrintLayout' with exactly the names of your printlayouts.

    Then use something like this in your PRINT button:

    let lay := text(PrintLayout);

    importFile(this, printAndSaveRecord(this, lay), lay + Invoicenumber + ".pdf");

    So it's maybe wise to call your printlayouts on how you want to call your PDF's also.

    Saving to a certain path is not easy to do, but maybe doable with some code and API, maybe even javascript...

    Maybe a API specialist can jump by this post?

      • Gianluca
      • 1 yr ago
      • Reported - view

      RoSoft_Steven I've set the button after your suggestion, but I can't see anything happen nor I can find the file that has been created: are the files saved somewhere special? 

      I'm on a Mac App and if I do this manually, it saves the pdf of the desktop.

      • Ninox partner
      • RoSoft_Steven.1
      • 1 yr ago
      • Reported - view

      Gianluca Normally you should find the pdf’s in the attachment Tab of the form.

      • Gianluca
      • 1 yr ago
      • Reported - view

      RoSoft_Steven Thank you! Found them right there...dumb me!

    • Mel_Charles
    • 1 yr ago
    • Reported - view

    I use some dedicated buttons for a common print layout ie a Delivery Note. The Other Notes button give a choice as per Steven's suggestion ie as per example

    let result := dialog("Print Other Delivery Notes", "Print Part Order Delivery Note (YES) or Print Plain Note (NO)", ["Yes", "No"]);
    if result = "Yes" then
        printRecord(this, "Part Order Note")
    else
        if result = "No" then
            printRecord(this, "Plain Note")
        end
    end

    and my Parcel Label button does exactly what it says on the button - I could combine it all into one button but for my delivery notes I like the separate options.

     

    No idea about point 2...

    • Gianluca
    • 1 yr ago
    • Reported - view

    RoSoft_Steven  and Mel Charles

    Thank you both. I think I'll try both suggestions and then decide which one fits better :):)

Content aside

  • 1 yr agoLast active
  • 6Replies
  • 158Views
  • 4 Following