Jump to content

How to schedule to send by email a report in pdf, excel file a certain analysis?


Enkeled Kanaj
Go to solution Solved by Olivier Keugue Tadaa,

Recommended Posts

Hi Enkeled,

You could either use automation services for that or you can use the Alerting Framework for Spotfire.

The first one is build in functionality, where you can set up an automation job (via Tools --> Automation Services job builder). Once you have created a job, you can then set a schedule for it, on the Admin Console:
image.thumb.png.930dd2fa9bbd1eefafa22b4b74af76d7.png

More information can be found here: https://docs.tibco.com/pub/spotfire_server/latest/doc/html/TIB_sfire_autsvcs_UserGuide/autoservices-homepage.html

The second option, the Alerting Framework for Spotfire, is an extension that can be found on our Exchange page: 

It is seamlessly integrated with Automation Services and adds extra functionality to it, like receiving alerts when certain thresholds are reached.
You may want to see this is a more fine-granular way to send out e-mails with pdf, etc.

But if that's not applicable (for now), I would suggest to use the native built-in functionality first.

Kind regards,

David

Kind regards,

David

 

 

Link to comment
Share on other sites

Hi Enkeled,

There is a certain order in the tasks, that you have to apply before you can use the Send email task.

The below overview is the minimum set of steps needed if you want to save an automation services job, that loads a dxp file, exports a pdf and sends an email with that pdf:
image.thumb.png.17e38cdd0d7931c9ab8ee5f17424d4d6.png

The Open Analysis from Library selects your dxp file.

The Export Report to PDF exports a predefined pdf report to a location:
image.thumb.png.905f2f1063a240d01ab4428e8d44c5db.png
Note 1: The Destination path is a folder on the Spotfire server/nodemanager side. It's not a local one! If you want to use a shared folder, you have to grant read/write access to the Spotfire service account and open it up via the node manager configuration.
Note 2: the predefined pdf report has to be created via File --> Export --> Visualization to PDF and select Prepared report (here you can create a New report, that can be used in the second task):
image.thumb.png.d8c82e4568afbc9795367da54ffbfaff.png
 

The third step, the send email task, is the final task, where you define the recipients and attach the exported pdf in task 2 (make sure you have exported the pdf once before, otherwise you can't find it):
image.thumb.png.443731f18157e1c9f64d9a48258b1ab8.png

You can run the job locally or via the server to test it. Once ok, you can then save the job and set a job schedule.

Kind regards,

David

Link to comment
Share on other sites

Hi Enkeled,

Right, so you need to set the SMTP settings first, before you can successfully send an email via the Spotfire server.

You can see these two articles to get this sorted:
https://docs.tibco.com/pub/spotfire_server/14.4.0/doc/html/TIB_sfire_autsvcs_UserGuide/autoservices/topics/adding_smtp_settings_to_the_spotfire.dxp.worker.automation.config_file.html

https://support.tibco.com/s/article/Spotfire-Automation-Services-Send-Email-task-fails-with-error-Failed-to-send-email-using-SMTP-server-smtp-company-com

The global idea is, you have to configure the SMTP settings in the automation services config file, that you first need to export to file, make the necessary changes and import it back into Spotfire. Once done, you need to update the automation services on your environment, so it will use the new configuration instead of the default one.

Kind regards,

David

Link to comment
Share on other sites

Posted (edited)

Hi @David Boot-Olazabal

We have export modified and import back the file but now we get :

Automation job 973827c8-6b8f-4067-9db3-4b0cda459045 failed in task 2 Send Email: Missing email host setting."

 

image.png.8bc2bdb36002bb47abc47a2bd766c4ac.png

Could you provide an example of how to specify the email settings? Should we use an IP address and port, such as 10.20.*.*:25, or should we use a hostname and port instead?

Also, how can we obtain the IP address of the Spotfire server that sends the emails?

 

 

Edited by Enkeled Kanaj
Link to comment
Share on other sites

  • Solution

Hi Enkeled

 

Don't change the property names (the hidden part on your screen) but the value. The error states that the program did not find the expected properties (since you renamed them)

See below an example of what it should look like (change the values) 👇

    <preferences>
      <!-- SMTP Host for Email Notification -->
      <add name="Spotfire.Automation.SendMail.SMTPHost" value="smtp.gmail.com" />
      <!-- From Address for Email Notification -->
      <add name="Spotfire.Automation.SendMail.FromAddress" value="olivier.keuguetadaa@cloud.com" />
      <!-- Timeout (seconds) for the library import operation for the Import Library task -->
      <add name="Spotfire.Automation.LibraryImport.TimeoutInSeconds" value="300" />
      <!-- Timeout (seconds) for the library export operation for the Export Library task -->
      <add name="Spotfire.Automation.LibraryExport.TimeoutInSeconds" value="300" />
      <!-- A file path that can be used when exporting images, PDFs and data from the different tasks to the file system. -->
      <!-- This path can be inserted into the different paths using the Insert Field in Job Builder dialog. -->
      <!-- Note the path must be a fully qualified path like '\\server\share' and not a relative path. -->
      <add name="Spotfire.Automation.Common.ExportPath" value="" />
    </preferences>

 

 

 

Link to comment
Share on other sites

On 8/2/2024 at 11:23 AM, David Boot-Olazabal said:

Hi Enkeled,

There is a certain order in the tasks, that you have to apply before you can use the Send email task.

The below overview is the minimum set of steps needed if you want to save an automation services job, that loads a dxp file, exports a pdf and sends an email with that pdf:
image.thumb.png.17e38cdd0d7931c9ab8ee5f17424d4d6.png

The Open Analysis from Library selects your dxp file.

The Export Report to PDF exports a predefined pdf report to a location:
image.thumb.png.905f2f1063a240d01ab4428e8d44c5db.png
Note 1: The Destination path is a folder on the Spotfire server/nodemanager side. It's not a local one! If you want to use a shared folder, you have to grant read/write access to the Spotfire service account and open it up via the node manager configuration.
Note 2: the predefined pdf report has to be created via File --> Export --> Visualization to PDF and select Prepared report (here you can create a New report, that can be used in the second task):
image.thumb.png.d8c82e4568afbc9795367da54ffbfaff.png
 

The third step, the send email task, is the final task, where you define the recipients and attach the exported pdf in task 2 (make sure you have exported the pdf once before, otherwise you can't find it):
image.thumb.png.443731f18157e1c9f64d9a48258b1ab8.png

You can run the job locally or via the server to test it. Once ok, you can then save the job and set a job schedule.

Kind regards,

David

Hi @David Boot-Olazabal

Is there a step to run the report then save and send by email?

We want to run the report then to send.

Thanks

Link to comment
Share on other sites

  • 2 weeks later...

Hi Enkeled,

There is no 'one step fits all' to run and send a report by mail. You have to use the order of steps when using an automation services job.
However, if you set up the Alerting Framework for Spotfire (https://community.spotfire.com/files/file/206-alerting-framework-for-spotfire®/), you may achieve this with the use of alerts.

As the Alerting Framework uses the underlying Automation services to send mails, once an alert is defined, it will do all the tasks (or steps) for you in one single alert.

Kind regards,

David

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...