Showing posts with label conditional logic. Show all posts
Showing posts with label conditional logic. Show all posts

Thursday, July 14, 2016

How to detect if Jasper Reports output was generated by a scheduled run

Sometimes it is necessary to have some conditional logic in case a report is being run by a scheduler. In this case it is possible to use _ScheduledTime parameter from the built-in REPORT_PARAMETERS_MAP map.

Example expression:

$P{REPORT_PARAMETERS_MAP}.get("_ScheduledTime") == null ? "Normal" : "Scheduled"