Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
Would like to generate a report based on the inputs from different sensors and then send this report as an email attachment.
The Mail Extension (PTC supported) has a service called "SendMessageWithAttachment" which allows you to send an email with attachment.
What are your requirements around the report (file format etc)?
A Pdf format or excel with the dataset should do.
can this be automated?
Hi @AP_10483126
PTC does not have a PDF extension, however IQNOX.com who is a PTC partner maintains and supports the CSV Parser extension. This is a free extension but you will have to create an account on their site.
The report can be automated through the use of the Scheduler and Subscription.
Regards,
Arshad
AP,
Our company is also a PTC partner; we have been sending html-formatted reports for several years now, and it is quite easy once you have ThingWorx set up with an Email Thing. For all of the following, do NOT include the "<", ">" brackets. Replace the contents with YOUR information!
STEP 1: Set up a Notification Handler and include a service to handle the sending of an email. The output of the service is a STRING:
See attached file "Stripped down Notification Handler.txt"
STEP 2:
Write your database thing service. Our reports use stored procedures; run the DB Thing service as a QUERY, not a command! This is where we query the data and format the HTML output. If you're pulling data from sensors, just send the params to the stored proc instead. View the attached file "Stripped Down Formatted Email Stored Procedure.txt"
Hope this helps some. We also have javascript that allows us to export formatted data and send it as an email. However, it isn't nearly as robust and it can't handle much data. I've emailed up to 500 rows of data via the stored procedure with no problems. You can also set up a scheduler to fire the handler on a scheduled basis. So if you are storing data from sensors in a database, this is the easy way to send it.