import re
from datetime import datetime


def buildReportName(appName, reportName):
  """Constructs report name from app + user supplied report name"""
  reportName = reportName if reportName else '{}-{}'.format(appName, datetime.now().strftime('%Y-%m-%d-%H:%M:%S'))
  reportName = re.sub(r'[^\w\-:_\. ]', '_', reportName)
  return reportName