PHP_XLSXWriter icon indicating copy to clipboard operation
PHP_XLSXWriter copied to clipboard

Implement explicitly setting column types

Open penzin opened this issue 5 years ago • 1 comments

I've faced with needs to explicitly set column types, so I've decided to separate set column types method and set header method. Because it was impossible, for example, set types for columns with the same names. See ex12-column-types.php.

penzin avatar Dec 02 '19 14:12 penzin

I agree with @penzin ... I have run across a case just last week where I really needed to have 2 sets of column headings have the same value, and I ended up having to go with a _1 and _2 added to the name. I would really like to see the option of the header array being able to be separated into 2 arrays, one for names and one for types.

For backwards compatibility, it seems that writeSheetHeader() would need a 4th optional parameter for the second array (either the column names or the types), that if not set, the function would behave as it does now. I believe that it is rare that multiple column names share the same value, but it does happen, as it did for me the first time last week.

Thanks!

seattledeveloper avatar Dec 02 '19 17:12 seattledeveloper

As #251 resolved, closing this PR

penzin avatar Jul 13 '23 19:07 penzin