Conditions | 2 |
Paths | 2 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
33 | public function initWorkSheet($filename='') |
||
34 | { |
||
35 | if(!empty($filename)){ |
||
36 | $this->setFileName($filename); |
||
37 | } |
||
38 | $this->spreadSheet = IOFactory::load($this->fileName); |
||
39 | //获取sheet表格数目 |
||
40 | $this->sheetCount = $this->spreadSheet->getSheetCount(); |
||
|
|||
41 | //默认选中sheet0表 |
||
42 | $this->spreadSheet->setActiveSheetIndex($this->sheet); |
||
43 | $this->workSheet = $this->spreadSheet->getActiveSheet(); |
||
44 | //获取表格行数 |
||
45 | $this->rowCount = $this->workSheet->getHighestDataRow(); |
||
46 | //获取表格列数 |
||
47 | $this->columnCount = $this->workSheet->getHighestDataColumn(); |
||
48 | //初始化所有列数组 |
||
49 | $this->cellName = $this->getCellName($this->columnCount); |
||
50 | return $this; |
||
51 | } |
||
55 |