The Save as PDF script step has an option to open an email with the PDF as an attachment.
- Add a container field to your table.
- Use the inspector to give the chart layout object an object name
- Set up your button to perform this script:
Set Field [YourTable::ContainerFieldHere ; GetLayoutObjectAttribute ( "ChartObjectnameHere" ; "Content" ) ]
Set Variable [$Path ; Get ( TemporaryPath ) & "ChartImage.png" )
Export Field Contents [ YourTable::ContainerFieldHere ; $Path ]
Send Mail [ ] ----> Use $Path to specify this image file as an attachment
i can that without create container field in my table
Because i donot need stored this container field to database
I have lots of charts this just example
If you want to store an attachment to send it via email, then you need to store it somewhere.
To add on to the above script, when you are done sending the mail, just clear the container using:
Set Field [YourTable::ContainerFieldHere ; "" ]
This is what global fields are used for.
You only need one container field. You can use the same field for every chart image. It can even be a global field. But you do need that field somewhere in order to produce the needed file and attach it.
Thank you again for everything you’ve done
I am able to successfully export the chart to a container. I am using an external, open container field (so I can display the images from the web server). It appears to create 2 files. Untitled.jpg and Untitled.png. Is there a way to tell it to just create one of these? Is it possible to name the file by calculation?
Any suggestions would be appreciated.
As I understand the process, the additional file is a thumbnail of the chart image.
Ahh. That makes sense. Any way to name the file when it's saved in the container?
You can name the file by exporting from the container. So you can export field contents to the temporary folder, specifying the name that you want, then re-insert it back into the original container if you want to store a copy in that way.
After getting this to work on FMPA16, I found this line in the GetLayoutObjectAttribute ["Chart_Graphic"; "Container"] Logical Function.
"In FileMaker WebDirect, when this function acts on a web viewer or a chart, the content and source attributes return an empty string."
Is there any way to programmatically export a chart to a graphic container or file on the server in WebDirect?
There's no simple way to do that with just FileMaker native functions. You could, in theory at least, create a record in a special table that identifies the records to be used to create the chart. A robot file running on a FileMaker client could make period checks for new records in such a table and then produce the needed chart image in the resulting client session.
The other option might be to generate a PDF of a layout on which the chart object is located. Doesn't 16 offer new options for PDF's from WebDirect clients?