/** * generate data provider array (dataProviderList) based on income string * * @param value String value * @throws DocumentException */ protected function generateFromString($value) { if (DataUtils::valueIsMethod($value)) { $this->dataProvider = DataUtils::getValue($value); $this->generateTableData(); } else { $bufMap = array(); $bufMap["name1"] = $value; $data = array($bufMap); $this->generateFromArray($data); } }
public function write() { parent::write(); if ($this->value == null || strlen($this->value) == 0 || $this->fontSize == 0) { return; } $font = $this->getFont(); $font->setFont($this->componentPdfWriter); $this->componentPdfWriter->SetXY($this->getPageX(), $this->getPageY()); $val = DataUtils::getValue($this->value); if ($this->width == 0) { $this->width = $this->componentPdfWriter->GetStringWidth($val); } $this->componentPdfWriter->MultiCell($this->width + 6, $this->fontSize + 6, $val, 0, "L", false); }
public function getColumnWidth(DataGridColumn $column) { $lenths = array(); foreach ($this->dataProviderList as $data) { $lenths[] = strlen(DataUtils::getValue($data[$column->dataField])) * $this->fontSize; } return max($lenths); }
public function buildOnMethod($value) { return Builder::buildDocument(DataUtils::getValue($value)); }
/** * Write one row of data into the table: {@link PdfPTable} * * @param table {@link PdfPTable} * @param row array of string values to be placed * @param rowFontStyle font style for current row * @throws DocumentException */ private function writeRow($row) { $value = DataUtils::getValue($row); $this->componentPdfWriter->Cell($this->width, $this->rowHeight, $value, 0, 0, "L", true); $this->componentPdfWriter->Ln(); }