/**
   * {@inheritDoc}
   *
   * @throws ReportRunException
   */
  public synchronized String runReport(Report report, String reportDirectory)
      throws ReportRunException {

    String outputFile = null;
    try {
      outputFile =
          generateReportName(reportDirectory, report.getReportName(), report.getReportFormat());
      JasperPrint print = runAndRender(report);
      outputFile = saveReport(print, report.getReportFormat(), outputFile);

    } catch (JRException e) {
      LogUtils.errorf(this, e, "Error running report: %s", e.getMessage());
      throw new ReportRunException("Caught JRException: " + e.getMessage());
    } catch (Throwable e) {
      LogUtils.errorf(this, e, "Unexpected exception: %s", e.getMessage());
      throw new ReportRunException(
          "Caught unexpected " + e.getClass().getName() + ": " + e.getMessage());
    }

    return outputFile;
  }