public function postReportExecution($resource, $options, $response) {
        //Create a new instance of the report history entity
        $rh = new ReportHistory();

        //Convert the parameters to json
        if (isset($options['parameters'])) {
            $rh->setParameters(json_encode($options['parameters']));
        } else {
            $rh->setParameters('{}');
        }

        //Set formats to empty until post cache
        $rh->setFormats('{}');

        //Get the request id from the response
        $rh->setRequestId(JasperHelper::getRequestIdFromDetails($response));

        //Set everything else
        $rh->setDate(new \DateTime());
        $rh->setReportUri($resource);
        $rh->setUsername($this->securityContext->getToken()->getUsername());
        $rh->setStatus('executed');

        //Persist and flush
        $this->em->persist($rh);
        $this->em->flush($rh);
    }