how to duplicate cell's datatype?

Sep 11, 2009 at 10:22 AM

Hi,

Some functions were deprecated in ver 1.70 (like duplicate). For example, duplicate style was simplified by using "getstyle('a1:b2')";  im wondering if is there a new way/function in duplicating cell's data type. Can you please give some example. Thanks

 

vile :)

 



 

 

Sep 11, 2009 at 12:16 PM

is there a wiki abbout getcell? what is explicit value? 

Developer
Sep 12, 2009 at 12:03 AM

>> im wondering if is there a new way/function in duplicating cell's data type.
>> Can you please give some example.


I am not sure you want to duplicate data types? Normally, one should set the data type when one sets the cell value. Example:

$cell->setValueExplicit('123', PHPExcel_Cell_DataType::TYPE_STRING);

Where do you see any need for duplicating the data type?

>> is there a wiki abbout getcell? what is explicit value?

When you type values in MS Office Excel it automatically determines the data type based on what you are typing. This can sometimes be annoying and it can be difficult the enter text if it looks like a number. Therefore setValueExplit() was introduced. It gives you better control. Example:

$cell->setValueExplicit('123', PHPExcel_Cell_DataType::TYPE_NUMERIC); // will be number
$cell->setValueExplicit('123', PHPExcel_Cell_DataType::TYPE_STRING); // will be string

If you are generating large workbooks I recommend that you use setValueExplicit(<value>, <dataType>) whenever possible. It is faster than setValue(<value>) and can make a difference, typically approx. 10% faster because it skips certain checks.

 

Sep 12, 2009 at 9:54 AM

ok got it.  thanks.

i wish you  have a documentation something like this -> http://docs.jquery.com/UI/Accordion
it would help a lot. 

Coordinator
Sep 12, 2009 at 3:58 PM

Well we do have the PHPExcel Developer Documentation and PHPExcel Function Reference Developer Documentation in the Documentation directory, and the API is documented in the Documentation/API directory, together with all the examples inthe Tests directory.

http://docs.jquery.com/UI/Accordion is basically an API document not that dissimilar to our own