Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Printing / Non Printing PDF

Featured Replies

Hi,

I have a invoice database set up in which I'd like to control whether or not certain objects print through a script.

The reason for this is that I either print an invoice onto headed notepaper or export it to pdf. If I'm exporting it to pdf I like it to have the company logo/details included in the pdf but when I print it I want these omitted (as they're already on the notepaper).

At the moment I have added the logo/details in a layout and then manually set them to print or not print depending on whether I'm exporting to pdf or printing.

What I'd like to be able to achieve is a button which runs a script setting the state of the logo/details to print and then exporting the record to pdf. Or at least that's my way of thinking about it. Might be simpler ways out there??

I'm not particularly up on scripting in filemaker but any help much appreciated.

Thanks.

  • Author

I've thought of a simpler way round this by just duplicating the sheet and have set up a button to export to pdf using the Invoice Number as the filename.

The logo/details are set up to print on one and not the other.

If there's a better way I'd be interested to know?

You could have the graphics and pre-printed stuff evaluate into calculation fields.

Use a check box marker to print to "PDF" or "Paper" and evaluate the contents of the graphics based on the check box.

The method you chose is absolutely fine though.

  • Author

Like the sound of that but I'm not sure how to 'evaluate the contents of the graphics'. i.e. how can I determine whether or not something prints or not? Not obvious to me in the scriptmaker.

  • Author

OK, so bit more detail on this.

So far I've got to the point where I have a button I've called 'Print Options' and a checkbox (called Print) with options for 'PDF' or 'Print'.

Pressing 'Print Options' calls a script I've called PrintWhat:P

[color:red]If [MFNorth Invoices::Print = "PDF"]

Perform Script ["PrintPDF"]

Else If [MFNorth Invoices::Print = "Print"]

Perform Script ["PrintPaper"]

End If

PrintPDF (Gets invoice number and exports pdf with inv no for filename)

[color:red]Set Variable [$Path; Value:"file:../../../Desktop/"]

Set Variable [$Filename; Value:MFNorth Invoices::InvoiceNumber]

Set Variable [$FilePath; Value:$Path & $Filename]

Save Records as PDF [Restore; No dialog; "$FullPath"; Current record]

PrintPaper

[color:red]Print []

So I've got to the point where I can check the relevant box and then either print or export to pdf accordingly. If I could just add to the print script to turn off the graphic elements I'd be a happy bunny!

Any further advice much appreciated.

  • Author

I know I'm talking to myself here but if this helps anyone else I've resolved this now.

All I did was create a field called 'Logo' and made it a container. I then added the logo/image to it (In Browse mode right click on the container and add the image). I then placed this container outside of my page set up (i.e. out side the print area).

I then added another field called 'PrintLogo'. This was a calculation with it's result being a container.

Calculation was:

If ( Print = "PDF" ; ( Logo ) )

Now when I select PDF in the checkbox (as per earlier post) it loads whatever image you add to the container 'Logo'. I then repeated this for some other elements I wanted control of.

I'm not sure if this is the best way of getting about this but works for me.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.