From 5c651f6a2bccbc07c74f5448aaa91dac52126bf7 Mon Sep 17 00:00:00 2001 From: Vinicius Ferreira Date: Tue, 31 May 2016 13:38:09 -0300 Subject: [PATCH 1/2] Add Delimiter in Function --- xlsxwriter.class.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xlsxwriter.class.php b/xlsxwriter.class.php index 7b95b6a66..3f9a3d8f8 100644 --- a/xlsxwriter.class.php +++ b/xlsxwriter.class.php @@ -137,12 +137,12 @@ protected function initializeSheet($sheet_name) $sheet->file_writer->write( ''); } - public function writeSheetHeader($sheet_name, array $header_types, $format = 'xlsx') { + public function writeSheetHeader($sheet_name, array $header_types, $format = 'xlsx', $delimiter = ';') { if (empty($sheet_name) || empty($header_types) || !empty($this->sheets[$sheet_name])) { return; } if ($format == 'csv') { - $this->writeCSVLine($header_types, true); + $this->writeCSVLine($header_types, true, $delimiter); } self::initializeSheet($sheet_name); @@ -159,12 +159,12 @@ public function writeSheetHeader($sheet_name, array $header_types, $format = 'xl $this->current_sheet = $sheet_name; } - public function writeSheetRow($sheet_name, array $row, $format = 'xlsx') { + public function writeSheetRow($sheet_name, array $row, $format = 'xlsx', $delimiter = ';') { if (empty($sheet_name) || empty($row)) { return; } if ($format == 'csv') { - $this->writeCSVLine($row); + $this->writeCSVLine($row, false, $delimiter); } self::initializeSheet($sheet_name); From 9762fb52026ea162200c4708fb3ef408d4053041 Mon Sep 17 00:00:00 2001 From: Vinicius Ferreira Date: Tue, 31 May 2016 13:40:55 -0300 Subject: [PATCH 2/2] Change false to null --- xlsxwriter.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xlsxwriter.class.php b/xlsxwriter.class.php index 3f9a3d8f8..444fc3073 100644 --- a/xlsxwriter.class.php +++ b/xlsxwriter.class.php @@ -164,7 +164,7 @@ public function writeSheetRow($sheet_name, array $row, $format = 'xlsx', $delimi return; } if ($format == 'csv') { - $this->writeCSVLine($row, false, $delimiter); + $this->writeCSVLine($row, NULL, $delimiter); } self::initializeSheet($sheet_name);