public function postReportCache($requestId, $options, $executionDetails) {
        //Find the report history entry with the given request id and update its status to cached
        $rh = $this->em->getRepository('MesdJasperReportBundle:ReportHistory')->findOneByRequestId($requestId);

        //Check that the report is not empty
        $totalPagess = $executionDetails->xpath('//reportExecution/totalPages');  
        //Yeah, I seriously called the variable that... I'm not good at naming things
        if (count($totalPagess) > 0) {
            $totalPages = (string)$totalPagess[0];
            if ($totalPages > 0) {
                $status = 'cached';
            } else {
                $status = 'empty';
            }
        } else {
            $status = 'empty';
        }

        if ($rh) {
            //Set the formats
            if (isset($options['formats'])) {
                $rh->setFormats(json_encode($options['formats']));
            }
            $rh->setStatus($status);
            $this->em->persist($rh);
            $this->em->flush($rh);
        }
    }