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.

Emailing a Report not working

Featured Replies

After reading previous posts, I thought I had the answer, but apparently not. I am trying to email a report, and I keep getting the 800 error, cannot save to this disc. Here is my situation in the script:

 

Find Records

Go to Layout 'Report'

Sort Records

Set Variable [$FilePath; Value: Get ( FilePath )]

Set Variable [$FileName; Value "Your Report"]

Save Records as PDF [Restore; No dialog; "$FileName"; Records being browsed]

Send Mail [send vis E-mail client; No dialog; to: "[email protected]"; Subject: "Your Report from " & Table::RequestByName; Message: "This is your report."; "$FileName]

 

 

At the Save Records point is where I get the 800 error. For specify output file I had: filemac:$FilePath/$Filename

 

What am I not doing correctly?

 

Thanks for the help.

Get ( FilePath ) returns the path to your solution file. You cannot use it the way you are trying to, because it's not a path to a folder. If you are trying to export to the same folder where your solution is, you can use a simple relative path:

 

file:$Filename

  • Author

Thanks!  That worked.

May I suggest that you use Get (TemporaryPath). This directory empties when the session ends, so you do not accumulate PDFs.

 

Set Variable [$FileName; Value "Your Report.pdf"]

Set Variable [$FilePath; Value: Get ( TemporaryPath ) & $FileName]
 

I have just now noticed that your file name is a constant. In such case you do not need to put in a variable - it doesn't accomplish anything. You can simply specify:

 

file:YourReport.pdf

 

as the output file.

 

 

 

Or, if you prefer to go with Barbara's suggestion (I would), do:

 

Set Variable [$FilePath; Value: Get ( TemporaryPath ) ]

 

then specify:

 

filemac:$FilePath/YourReport.pdf

 

as the output file.

I think the suggestion by Michael (Comment) is a good one but doesn't Get( temporaryPath) end with a "/" character? 

 

So - doesn't that end up looking like this:

 

filemac:/Macintosh HD/private/var/folders/_7/gytx2gzd617dk2qbxmynj6fw0000gn/T/S10//YourReport.pdf

 

Also, for debugging purposes, my preference would be to do something like this:

 

Set variable [ $fullpath; "filemac:" &  get( temporaryPath) & "YourReport.pdf" ]

 

Then just set the export step to use the variable $fullpath.

 

Also, if Pat had used this method, he (?) could have used the script debugger and variable watcher to see why his original get( Filepath) method didn't work.

 

He would have been able to see that it look something like like "file:/Macintosh HD/Users/Pat/Documents/Some Folder/Myfilename.fmp12/Report.pdf"

 but doesn't Get( temporaryPath) end with a "/" character? 

 

Yes, it does - and I used to remove it until I found out it made no difference.

 

I prefer to do the final concatenation in the "Specify File" dialog - but it's a minute detail and mostly a matter of personal preference. In this case I would probably go with your suggestion because the same full path is required twice - once for saving the file and once for attaching it.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

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.