Setting mail account for Subscription of scheduled Jobs in JasperServer.
I wanted to document the process from a long time but due to crunch of time I could not, but now I will like to explain the process in simple easy to follow steps.
First of all I would like to give an idea to problem addressed in the blog, basically when a report runs as a daily status or daily count one need not run it manually it could be scheduled, but when the report is scheduled the export in desired form is exported on jasper server.
But wait a minute do we really login and see what the results came as in the PDF, Excel etc. export, no we need not the problem is handled by mail subscription attached to the scheduler, which will automatically send the Exports to the subscribers on their email accounts and send a confirmation to the administrator.
So lets cut the explanation and lets jump directly into how to do.
1. You should have working copy of JasperServer community/pro
2. You should have uploaded a report to the server
3. Choose you favourite text editor (Windows(default) - Notepad/MacOS(default) - TextEdit)
4. Shut down the jasper server so that no sort of errors come in case of Editing/Saving documents.
after following the above prerequisites now we head on to edit two files as follows.
Both these files will be found at the location
<directory of Jasperserver on Disk>/apache-tomcat/webapps/jasperserver/WEB-INF/
- Edit the file with the Text Editor
Change the portion of the document as (Please select your own server details I have used a gmail account )
report.scheduler.mail.sender.host=smtp.gmail.com- Make the changes and save the file.
- Locate the bean reportSchedulerMailSender
- Locate the property javaMailProperties
- Do the changes as below - This will enable java to interact the smtp/startls authentication.
- Now save the document.
Now the report subscription is ready for run, just start the Jasper Server and you are good to go.