添加其他行时的PHP Excel问题

问题描述

我正在修改PHPexcel文档,在这里我只是调用一个函数来创建行,但似乎行数已锁定。我可以注释掉其中一个函数,另一个函数将起作用并创建一行,但是同时启用这两个函数只会为第二个函数创建一行。如何更改它以确保两个函数都在工作表上创建行?

    $hdrs[0] = '*Main*';
    $this->writeDataHeaders($xrow,$colstrs,$hdrs);
    $this->setFillColors($xrow);
    $block_range_start = "A" . $xrow;
    $xrow++;
    $arr = $sadata->getRowArray($conum,'main');
    $first_row = $xrow;
    foreach ($arr as $row) {
        for ($i = 0; $i < count($colstrs); $i++) {
            $cellstr = $colstrs[$i] . $xrow;
            $ows->setCellValue($cellstr,$row[$i]);
            $ows->getStyle($cellstr)->getNumberFormat()->setFormatCode($this->numfmt);
        }
        $this->setFillColors($xrow);
        $xrow++;
    }
    $last_row = $xrow -1;

    /*Issue starts here*/

    $this->writeSubrow($xrow,'Sub totals',$c,$first_row,$last_row,$total_cols);
    $this->writeRow($xrow,'Totals',$total_cols);
    $this->setFillColors($xrow);
    $block_range_end = "I" . $xrow;
    $ows->getStyle("$block_range_start:$block_range_end")->applyFromArray($border_style);

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)