From b880b5ff9d9825fb3758b2797a43b62ff0644c04 Mon Sep 17 00:00:00 2001 From: Mark Baker Date: Fri, 24 May 2013 09:29:43 +0100 Subject: [PATCH] Excel2007 reader wasn't always reading the print_titles properly, fix courtesy of watermark86 --- Classes/PHPExcel/Reader/Excel2007.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Classes/PHPExcel/Reader/Excel2007.php b/Classes/PHPExcel/Reader/Excel2007.php index 23a58b70..410025b7 100644 --- a/Classes/PHPExcel/Reader/Excel2007.php +++ b/Classes/PHPExcel/Reader/Excel2007.php @@ -1542,13 +1542,14 @@ class PHPExcel_Reader_Excel2007 extends PHPExcel_Reader_Abstract implements PHPE // Set print titles foreach ($extractedRange as $range) { $matches = array(); + $range = str_replace('$', '', $range); // check for repeating columns, e g. 'A:A' or 'A:D' - if (preg_match('/^([A-Z]+)\:([A-Z]+)$/', $range, $matches)) { + if (preg_match('/!?([A-Z]+)\:([A-Z]+)$/', $range, $matches)) { $docSheet->getPageSetup()->setColumnsToRepeatAtLeft(array($matches[1], $matches[2])); } // check for repeating rows, e.g. '1:1' or '1:5' - elseif (preg_match('/^(\d+)\:(\d+)$/', $range, $matches)) { + elseif (preg_match('/!?(\d+)\:(\d+)$/', $range, $matches)) { $docSheet->getPageSetup()->setRowsToRepeatAtTop(array($matches[1], $matches[2])); } }