예제 #1
0
 /**
  * Call all the necessary methods
  */
 public function read($directory, $fileName, $parameters, $config = array(), $left = 0, $top = 0, $subreport = false)
 {
     //geting the bean
     $xmlContent = FileUtils::readFile($directory . trim($fileName));
     //Turn the jrxml to bean
     $jasper = BeanUtils::xmlToBean($xmlContent, 'Jasper');
     //Get the db stuff
     $dbResult = null;
     if ($jasper->queryString) {
         $dbResult = DbConnection::getInstance()->listAll($jasper->queryString->content, $parameters);
     }
     $left += $jasper->leftMargin;
     $top += $jasper->topMargin;
     $jasperXml = new JasperXml();
     $jasperXml->dbResult = $dbResult;
     $jasperXml->config = $config;
     $jasperXml->jasper = $jasper;
     $jasperXml->parameters = $parameters;
     $jasperXml->directory = $directory;
     return $jasperXml->printJasper($left, $top, $subreport);
 }