当前位置: 首页>>代码示例>>PHP>>正文


PHP Spreadsheet_Excel_Writer::rowcolToCell方法代码示例

本文整理汇总了PHP中Spreadsheet_Excel_Writer::rowcolToCell方法的典型用法代码示例。如果您正苦于以下问题:PHP Spreadsheet_Excel_Writer::rowcolToCell方法的具体用法?PHP Spreadsheet_Excel_Writer::rowcolToCell怎么用?PHP Spreadsheet_Excel_Writer::rowcolToCell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Spreadsheet_Excel_Writer的用法示例。


在下文中一共展示了Spreadsheet_Excel_Writer::rowcolToCell方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: printRevisionReport

 /**
  * Формирует .xls данные о деньгах работодателей по текущим незакрытым сделкам за указанный период.
  *
  * @param array $filter фильтр по дате.
  */
 public function printRevisionReport($filter = null)
 {
     if (!$filter['to']) {
         $filter['to'] = array('day' => date('d'), 'month' => date('n'), 'year' => date('Y'));
     }
     if (!($rep = $this->getRevisionReport($filter))) {
         return false;
     }
     $period = $this->_createPeriodStr($filter);
     $rpss = self::$reports_ss['REV'];
     $COL_START = 0;
     require_once 'Spreadsheet/Excel/Writer.php';
     $workbook = new Spreadsheet_Excel_Writer();
     $workbook->send('СБР_сверка_' . str_replace('.', '_', $period[0]) . '.xls');
     $body_sty = array('FontFamily' => 'Arial', 'Size' => 10, 'Bold' => 1);
     $td_sty = array('FontFamily' => 'Calibri', 'VAlign' => 'vequal_space', 'Align' => 'center', 'Size' => 11, 'Border' => 1, 'BorderColor' => 'black', 'NumFormat' => '#');
     $th_sty = array('FontFamily' => 'Arial', 'Size' => 10, 'Align' => 'center', 'Border' => 1, 'BorderColor' => 'black', 'Bold' => 1);
     $l_sty = array('Align' => 'left');
     $r_sty = array('Align' => 'right', 'NumFormat' => '### ### ##0.00');
     $fmtBODY =& $workbook->addFormat($body_sty);
     $fmtBODYR =& $workbook->addFormat($body_sty + $r_sty);
     $fmtTD =& $workbook->addFormat($td_sty);
     $fmtTH =& $workbook->addFormat($th_sty);
     $fmtTH->setTextWrap(1);
     $fmtTDL =& $workbook->addFormat($l_sty + $td_sty);
     $fmtTDR =& $workbook->addFormat($r_sty + $td_sty);
     $worksheet = $workbook->addWorksheet('Сверка');
     $worksheet->setInputEncoding('windows-1251');
     $worksheet->setZoom(75);
     $worksheet->setColumn(0, 0, 2);
     // Заголовок
     $worksheet->write(0, $COL_START, $rpss['name'], $fmtBODY);
     $worksheet->write(1, $COL_START, 'Остатки кредиторской задолженности по сервису «Безопасная Сделка»', $fmtBODY);
     $worksheet->write(2, $COL_START, $period[0], $fmtBODY);
     $worksheet->write(2, 5, 'Дата ' . date('d.m.Y H:i'), $fmtBODY);
     $worksheet->mergeCells(0, $COL_START, 0, 6);
     // Шапка таблицы.
     $i = $COL_START;
     foreach ($rpss['columns'] as $f => $col) {
         $worksheet->setColumn($i, $i, $col[1][0]);
         $worksheet->write(4, $i, $col[0], $fmtTH);
         ++$i;
     }
     // Таблица.
     $i = 5;
     $sum_all = 0;
     foreach ($rep as $row) {
         $j = $COL_START;
         $sum_all += $row['sum_dept'];
         foreach ($rpss['columns'] as $nm => $col) {
             $worksheet->write($i, $j, htmlspecialchars_decode($row[$nm], ENT_QUOTES), $col[1][1] == 'right' ? $fmtTDR : ($col[1][1] == 'left' ? $fmtTDL : $fmtTD));
             ++$j;
         }
         ++$i;
     }
     // Дно таблицы (итого).
     $worksheet->write($i, 0, 'ИТОГО', $fmtBODYR);
     $worksheet->mergeCells($i, 0, $i, 2);
     $c1 = Spreadsheet_Excel_Writer::rowcolToCell(5, 3);
     $c2 = Spreadsheet_Excel_Writer::rowcolToCell($i - 1, 3);
     $worksheet->writeFormula($i, 3, "=SUM({$c1}:{$c2})", $fmtSR);
     $c1 = Spreadsheet_Excel_Writer::rowcolToCell(5, 4);
     $c2 = Spreadsheet_Excel_Writer::rowcolToCell($i - 1, 4);
     $worksheet->writeFormula($i, 4, "=SUM({$c1}:{$c2})", $fmtSR);
     $c1 = Spreadsheet_Excel_Writer::rowcolToCell(5, 5);
     $c2 = Spreadsheet_Excel_Writer::rowcolToCell($i - 1, 5);
     $worksheet->writeFormula($i, 5, "=SUM({$c1}:{$c2})", $fmtSR);
     $i += 3;
     $r = explode('.', (string) $sum_all);
     $worksheet->write($i, 0, "На {$filter['to']['day']}." . ($filter['to']['month'] < 10 ? '0' . $filter['to']['month'] : $filter['to']['month']) . ".{$filter['to']['year']} задолженность ООО \"Ваан\" в пользу Работодателей  по сервису «Безопасная Сделка»", $fmtBODY);
     $worksheet->write($i + 1, 0, 'Cоставляет ' . intval($r[0]) . ' руб. ' . intval($r[1]) . ' коп.', $fmtBODY);
     $workbook->close();
 }
开发者ID:kapai69,项目名称:fl-ru-damp,代码行数:78,代码来源:sbr_adm.php

示例2: Spreadsheet_Excel_Writer

<?php

require_once 'Spreadsheet/Excel/Writer.php';
$workbook = new Spreadsheet_Excel_Writer('rowcol.xls');
$worksheet1 =& $workbook->addWorksheet("rowcol");
$first = 1;
$last = 10;
for ($i = $first; $i <= $last; $i++) {
    $worksheet1->write($i, 1, $i);
}
$cell1 = Spreadsheet_Excel_Writer::rowcolToCell($first, 1);
$cell2 = Spreadsheet_Excel_Writer::rowcolToCell($last, 1);
$worksheet1->write($last + 1, 0, "Total =");
$worksheet1->writeFormula($last + 1, 1, "=SUM({$cell1}:{$cell2})");
$workbook->close();
开发者ID:f476559604,项目名称:xuanke,代码行数:15,代码来源:tt6.php


注:本文中的Spreadsheet_Excel_Writer::rowcolToCell方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。