Maximo Open Forum

 View Only

 BIRT Report - Email during report rendering

Jump to  Best Answer
  • Reporting
Stewart Lawrence's profile image
Stewart Lawrence posted 02-28-2022 05:41
Hi Folks

I have a question for the BIRT gurus out there. I have been requested to create a report in Maximo that groups open/in progress work orders by Vendor and as the report is rendering, an email should be sent to each vendor with their section/grouping of the report. 

I am told that this has been done before, however, I have not seen the solution in operation myself. I found some Java code that will send an email and have placed this in the onPageBreak method. My concern with the page break is that where a vendor's work order list is long, that an email will be sent after each page, rather than after the vendor grouping. Also, duding testing, two vendors appeared on the same page for just one page and the rest were on separate pages.

My bigger concern is getting the Java code to execute, but more importantly, how do I get a portion of a rendered report to be emailed? Is this even possible?

The reasoning behind this approach is to reduce administrative overhead so that the report does not need an individual schedule for each vendor, but has one schedule, once per week and will send to all vendors who have open/in progress work orders. So, if a new vendor is brought on, there is no need to create a new scheduled report and when a vendor is rolled off, there is no need to do a clean up of the scheduled reports.

Is there another way to achieve this outcome with the same minimal administration? I could use cron tasks, etc, but we want to avoid any custom coding within this implementation.

Thanks in advance to those able to help with this interesting question.

Regards

Stewart
Prashant Sharma's profile image
Prashant Sharma  Best Answer
Hi Stewart,

As you have mentioned, using page render is not a good idea.

You should use the automation script and run it via Cron task.
Refer https://www.ibm.com/docs/en/control-desk/7.6.0?topic=SSWT9A_7.6.0/com.ibm.mbs.doc/autoscript/t_cron_task_scripts.html

This script can be scheduled on weekly basis and you can execute report only for all active vendors. Once the vendor will be disabled report will not be generated.
Refer to this example- https://bportaluri.com/2019/09/script-run-report-save-as-attachment.html
(Only thing is there is no need for you to save this report as attachment as given above)
Stewart Lawrence's profile image
Stewart Lawrence
Hi Prashanth

Thank you for this solution. I had suspected as much that the solution mentioned was not directly done in the BIRT report itself. 

I will create the automation script and the cron task as mentioned. 

Thanks so much for your help on this and my previous question.

Regards

Stewart
Biplab Choudhury's profile image
Biplab Choudhury
This is an interesting requirement.
I would do this as below:

1. Create an escalation on the vendor object. Escalation as it will give you the freedom to modify the vendor list using sql queries rather than having this logic in auto script. It also gives the freedom of customising the run schedule for different kinds of vendors using escalation point( if ever this requirement comes up).
2. Then, I will create an auto script which will run the work order report. The work order report should accept the vendor name as parameter. Runreport api allows you to pass the parameters programmatically as well. So, the script will run work order report for each row of vendor data from escalation point. This will simplify your BIRT report to fetch work order data only for 1 vendor.
3. Autoscript will run the report and then attach the output pdf into an email and send it to the vendor. I will also use a communication template on Vendor object to send this email. Send email logic can be written using MXServer class's send email or commtemplate's send email function.

Hope this helps.

Cheers,
Biplab Das Choudhury,
IBM Champion 2022 | IBM Certified Maximo Consultant | AWS Certified Solution Architect Associate