예제 #1
0
 public function renderTable(TableContent $content)
 {
     $templates = array('widths' => $content->getTableWidths(), 'as_totals_box' => $content->getAsTotalsBox(), 'num_columns' => $content->getNumColumns(), 'data' => $content->getData(), 'headers' => $content->getHeaders(), 'auto_totals' => $content->getAutoTotals(), 'types' => $content->getDataTypes());
     if ($templates['auto_totals']) {
         $templates['totals'] = $content->getTotals();
     }
     $this->markup .= TemplateEngine::render(__DIR__ . '/html_templates/table.tpl', $templates);
 }
예제 #2
0
 public function renderTable(\TableContent $content)
 {
     $params = $content->getDataParams();
     $style = array('header:border' => array(200, 200, 200), 'header:background' => array(200, 200, 200), 'header:text' => array(255, 255, 255), 'body:background' => array(255, 255, 255), 'body:stripe' => array(250, 250, 250), 'body:border' => array(200, 200, 200), 'body:text' => array(0, 0, 0), 'decoration' => true);
     if ($content->getAsTotalsBox()) {
         $this->pdf->totalsBox($content->getData(), $params);
     } else {
         if ($content->getAutoTotals()) {
             $this->pdf->table($content->getHeaders(), $content->getData(), $style, $params);
             $totals = $content->getTotals();
             $totals[0] = "Totals";
             $this->pdf->totalsBox($totals, $params);
         } else {
             $this->pdf->table($content->getHeaders(), $content->getData(), $style, $params);
         }
     }
 }