Skip to content

Commit 39a725b

Browse files
committed
Fixed issue #63 writing for NULL values using writeRow()
1 parent c4928c2 commit 39a725b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

ChangeLog

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
[2014-??-??] - Version 1.0
2+
* Fixed issue #63 writing for NULL values using writeRow()
23
* Added excel.skip_empty INI setting that allows null values to be skipped, if set to 2 the empty strings will be skipped as well
34
* Added Sheet::setRightToLeft() and Sheet::setRightToLeft() methods that specifies whether the sheet in is "right to left" display mode
45
* Added Book::isTemplate() and Book::setTemplate() methods for detecting xltx files and converting from xlsx to xltx and vice versa

excel.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -2308,7 +2308,12 @@ static zend_bool php_excel_write_cell(SheetHandle sheet, BookHandle book, int ro
23082308
if (INI_INT("excel.ini_skip_empty") > 0) {
23092309
return 1;
23102310
}
2311-
return xlSheetWriteBlank(sheet, row, col, format);
2311+
if (!format) {
2312+
FormatHandle fmt = xlBookAddFormat(book, NULL);
2313+
return xlSheetWriteBlank(sheet, row, col, fmt);
2314+
} else {
2315+
return xlSheetWriteBlank(sheet, row, col, format);
2316+
}
23122317

23132318
case IS_LONG:
23142319
if (dtype == PHP_EXCEL_DATE) {

0 commit comments

Comments
 (0)