20,919,685Total Points24,106Total Sites23,382Cell Towers69,500Racks Monitored56,753HVAC Units Monitored31,322UPS Units Monitored24,788Generators Monitored20,919,685Total Points24,106Total Sites23,382Cell Towers69,500Racks Monitored56,753HVAC Units Monitored31,322UPS Units Monitored24,788Generators Monitored20,919,685Total Points24,106Total Sites23,382Cell Towers69,500Racks Monitored56,753HVAC Units Monitored31,322UPS Units Monitored24,788Generators Monitored

Chapter 7: Reporting & Historical DataLesson 39 of 65

How to Schedule and Deliver Automated Reports

Configure Mango by Radix IoT to automatically generate and email reports on a schedule, including daily summaries, weekly performance reports, and monthly compliance documents.

  • 7 min read
  • Intermediate
  • Mango 4.x / 5.x

Overview

Manual report generation doesn’t scale. Mango by Radix IoT’s Excel Reports module runs a report template on a schedule and emails the finished workbook, so stakeholders get the same report in their inbox every day, week or month without anyone pulling data. This guide covers the delivery side: the schedule, the email, testing, and keeping many reports running reliably. Building the template itself (named ranges, time periods, mapping points) is covered in Creating Excel Reports with Scheduled Email Delivery.

Prerequisites

  • The Excel Reports module. Its free license allows one report template; more than one needs the paid license (see Managing Many Reports)
  • Outbound email working: Administration > System settings > Email settings, with Disable sending emails unticked. Send test email there sends to your own user’s address
  • A report template whose time periods are Relative or Specific, not Not specified (Mango will not save a schedule otherwise)
  • Data points logging history for the periods you report on

Step 1: Open the Template and Set Its Periods

  1. Navigate to Analytics > Excel reports. The Report templates tab lists your templates; Finished / in-progress reports lists every run
  2. Select a template, or New template. Its editor has the tabs Report setup, Time periods, Post processing script, Schedule and Email (plus Email model script while email is on)
  3. On Time periods, set each period to Relative so every run computes its own window:
Report Date type Period count Period type Each run covers
Daily summary Previous 1 Days The previous complete day
Weekly performance Previous 1 Weeks The previous complete week
Monthly compliance Previous 1 Months The previous complete month
Shift report Past 8 Hours The 8 hours up to the run

Previous means complete periods before the current one; Past counts back from the moment the report runs.

Step 2: Set the Schedule

  1. Open the Schedule tab and tick Schedule this template to be run periodically. The Cron pattern field and the pattern builder appear under Select cron pattern
  2. Type a pattern into Cron pattern, or build one with the Second, Minute, Hour, Day of month, Month and Day of week menus
  3. Click Save

Mango’s cron patterns have six fields with seconds first: second, minute, hour, day of month, month, day of week. Put ? in whichever of the two day fields you are not using. Patterns run in the Mango server’s time zone.

Schedule Cron pattern
Every day at 6:00 AM 0 0 6 * * ?
Every Monday at 7:00 AM 0 0 7 ? * MON
The 1st of each month at 8:00 AM 0 0 8 1 * ?
Every 8 hours from midnight 0 0 0/8 * * ?

Warning

The pattern builder’s Second, Minute, Hour, Day of month and Month menus all start on Every. Choosing only Hour 6 produces * * 6 * * ?, which runs the report every second from 6:00 to 6:59, 3,600 times. Set Second and Minute to 0 as well, and read the Cron pattern field before you save.

Mango refuses to save a schedule it cannot parse, or one whose template still has a Not specified time period (Date range required for scheduled reports).

Step 3: Configure Email Delivery

  1. Open the Email tab. Email report is ticked on a new template; leave it ticked
  2. Under Email template, keep reportEmailBody.ftl unless you have your own
  3. Under Email recipients, add who receives it: Select users (Mango users, at their own email addresses), Select mailing lists, or type an address into Add email address and press Enter. Mango will not save an emailed template with no recipients
  4. Tick Compress attachments to send the workbook as a .zip
  5. Click Save

Each email attaches the finished workbook in the template’s own format (.xlsx, .xls or .xlsm). Its body, from the email template, summarizes the run: the report name, when it ran, how long it took, the record count, and each period’s dates and points. There is no CSV or PDF option, and the report’s data is not placed in the email body.

Note

The subject is Scheduled report - followed by the template’s name, unless the email template sets its own with FreeMarker’s <@subject> directive. Your own email templates are .ftl files in overrides/ftl/excelReports/ inside the Mango data directory; each one appears in the Email template list.

Mailing lists live at Event Management > Mailing lists. Use them instead of individual addresses, so a change of staff is one edit.

Step 4: Test the Report

  1. On Report templates, click Run (the play icon) on the template’s row. Run uses the saved settings, so with Email report ticked every recipient gets the email
  2. To test without emailing everyone, click Configure and run (the clock icon) instead, untick Email report in its dialog (you can also change the time range for this one run), and click Run
  3. Open Finished / in-progress reports. Each run moves through Queued and Running to Finished, Failed or Email failed. Download and View open the file
  4. Check that the file holds data for the period you expected, and that the email arrived with its attachment

Other Ways to Deliver a Report

Method How Best for
Email The Email tab, as above Stakeholders who want the file in their inbox
Download Download or View on Finished / in-progress reports People with the template’s Read generated report permission
REST API POST /rest/latest/excel-reports/run/{template XID} queues a run and returns it; poll GET /rest/latest/excel-reports/{report XID} until state is FINISHED, then GET /rest/latest/excel-reports/download/{report XID} Pulling files into another system or an archive
On an event An Excel report event handler runs a template when an event is raised or returns to normal Alarm-driven reports

Warning

Mango deletes finished reports after 1 month by default (Administration > System settings > Excel reports, Purge report instances older than). Tick Prevent purge on a template to keep its reports, or keep your archive outside Mango.

Managing Many Reports

  • Check the license first. With more templates than the license allows, every run fails with Excel Reports module is licensed for fewer templates than exist. A manual Run shows the error; a scheduled run only writes it to the log
  • Stagger schedules. At the default Work item priority of Low (Administration > System settings > Excel reports), Mango’s own help says “Low priority will run reports in the order they are scheduled one by one”, so ten reports due at 6:00 queue behind each other. Offset them by a few minutes, or choose High or Medium, which let several run at once
  • Name templates by site and frequency: “BLDG-A Daily Summary”, “ALL-SITES Weekly Performance”
  • Watch Finished / in-progress reports for Failed and Email failed runs

Verification

  • A test run reaches Finished in Finished / in-progress reports
  • The file opens and holds data for the expected period
  • The email arrives with the workbook attached
  • The Cron pattern reads as intended, seconds first
  • The first scheduled run appears in Finished / in-progress reports at the expected time

Troubleshooting

Issue Cause Fix
State Email failed, or nothing received Outbound email disabled, misconfigured or blocked Use Send test email under Email settings; check Disable sending emails and spam filters
The file has no data The period covers time with no logged history, or the template’s Report execution roles cannot read the points Check the period and the points’ logging; grant those roles read permission on the points
The schedule never fires The box is not ticked, the pattern means something else (seconds come first; server time zone), or the license is exceeded Re-read the Cron pattern; check the Mango log for license errors
Runs pile up in Queued Low priority runs reports one by one Stagger the schedules, or raise Work item priority
Thousands of runs in an hour The builder’s Second or Minute was left on Every Set both to 0
Very large file or a long run Raw data at a high sample rate Add a rollup on the time period; report fewer points
Older reports are gone The purge removed them after 1 month Tick Prevent purge, or archive through the REST API

Get free access to all 65 Mango by Radix IoT training lessons

One short form unlocks every lesson and its video in this browser.

This form is hosted by Zoho. It loads only after you enable support cookies or choose to load it below.

We honored your browser’s Global Privacy Control signal — optional cookies are off and nothing is tracked.