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.

I would like the FMP reporting script to save a .PDF

Featured Replies

I would like to run a report and of course view in preview mode. I would like the FMP reporting script to save a .PDF of this report into the parent record generating this report. Relationship would be something like this; ParentProjectTable > ChildReportsTable.

If I can avoid it, I would like to NOT save/export a file to desktop and then import. I would just want to save file straight into FMP, this may not be possible? I want to avoid saving to desktop because database will be used by multiple users and they have there own prefs on where they want to save files. Also, I want to avoid the (Can not find file path) notice. I think GOOD scripting can solve these issues, but I am not hip.

How can I do this, any help? THANK YOU as always.

I figure my questions kinda relates to this one.

I fail to see the connection myself.

I would just want to save file straight into FMP, this may not be possible?

No, it's not possible.

I want to avoid saving to desktop because database will be used by multiple users and they have there own prefs on where they want to save files.

You could use the path to temporary folder. If your script inserts the exported file into a container field, then users do not need to be aware of the file's interim location.

  • Author

Sorry on the topic relation. Should I start a new post?

I will build a demo file and try to make this work and share shortly. Thank you for your tips!

I split your question off into it's own Thread.

  • Author

I have built script and I'm using

Set Variable $Path = Get (TemporaryPath)

But I'm getting an error on the Export Records as PDF.

Error says "Can not save "" file on this disk... etc." then of course on the import of file I get error of File <Unknown> can not be found.

I am missing a step or three I'm sure, like setting the name of the file, where do I set the name at?

demo_historic_pdf.fp7.zip

Yes, you are missing a file name. Try setting the $path variable to =

Get (TemporaryPath) & GetAsNumber ( Get ( CurrentTimeStamp ) ) &  Int ( Random * 10^6 ) & ".pdf"

  • Author

Thanks comment! That fixed everything.

The suggestion you gave on the file name seems to be the best bet to create a truly unique id in time!

Tho I would display this file in a portal list and a string of numbers means nothing to the user.

My question is should I keep the file name as you suggested (stamp,random) and create a separate field that display a "readable" name e.g. 4536_QUOTE_Company_2011-12-09.pdf

Or could I get away with naming file like my example?

Also I would need to build a "safeguard" sorta speak, so when report script is ran it ask User "Are you sure you want to create a NEW report? Or would you like to view existing QUOTE?

Script would check if there is an existing QUOTE, if not, then generate new quote. Goal is to prevent excess stored duplicate QUOTEs. Multiple quotes are allowed if quote-report is unique.

Thanks for your help!

The file name can be anything (I am guessing you'd want something that can be calculated, otherwise you will need user input).

You don't need a field for this, you can do calculation in the Set Variable[] step.

Edited by comment

  • Author

Correct. I do want a calculated naming convention.

I understand I can name file what ever desired in the Set Variable step, I was just wondering if I could get into trouble if I veered from the unique file name like you suggested.

I don't think so, because the file is saved locally and any previous file with the same name will be overwritten.

  • Author

4-8 pdfs per record, 1,000's of records. Would referencing to the pdf be a better idea?

Hard to say without any background. Why is it necessary to keep the reports at all?

  • Author

The documents are the legal and official business side of the company. Bid Request, Agreements, Purchase Orders, Etc... are important to have on file showing the project has been properly documented. Multiple Agreements may be printed or "filed" as project details evolve. The company needs this history documented.

Agreements, etc are generated from ParentProject and ChildAssignments.

Unless the Assignment has been marked as invoiced, Assignments can be modified. So the first agreement may differ from the second Agreement depending if assignment(s) have been modified.

Well, from a database perspective, the existence of a file is not the best way to keep track of facts. If an item is finalized, it should have a date in a DateFinalized field - and that determines the item's status regardless of any file being produced (or not) at the same time (not to mention existing or not at a later time).

From a legal point-of-view, I am not sure I would be happy to deposit all my documents into a .fp7 file.

  • Author

Thanks!.. Well of course, as always, you are right!

I need to revisit the flow of assignment state and force User to follow protocol.

Basically once Assignment Agreement has been published, not allow further edits.

Question is, how can I handle a Change Order? Because Change Orders are inevitable.

If Agreement has been published and Assignments are no longer editable then a NEW Assignment would have to be created to cancel out and show modification to the original Assignment record. Maybe this is a good method sense the old Assignment would still exist, but is in a canceled state, and show history of previous publishings???

I like the Assignments editable even if an Agreement has been published; to keep the Project from getting too bloated with updated "Change Order" Assignments over minor edits. But I "think" this is a business operations issue, not the database.

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.