Advanced Value Binder Not Working?

Topics: Developer Forum
Sep 10, 2010 at 9:21 AM

I'm setting the default binder with the standard code (below) but it still doesn't seem to be recognising percentages or dates and formatting them correctly in the outputted Excel file. I don't know if I'm reading into what this should actually do wrong or not, but when trying the 29advancedvaluebinder test too, only the percentage is actually anything other than 'General' in the resulting excel file. Shouldn't this be setting them to the number correct formats in the actual Excel 2007 spreadsheet?

Thanks in advance,

Josh

 

PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );

 

Coordinator
Sep 10, 2010 at 12:36 PM
On 10/09/2010 10:21, jfbarnes wrote:

I'm setting the default binder with the standard code (below) but it still doesn't seem to be recognising percentages or dates and formatting them correctly in the outputted Excel file. I don't know if I'm reading into what this should actually do wrong or not, but when trying the 29advancedvaluebinder test too, only the percentage is actually anything other than 'General' in the resulting excel file. Shouldn't this be setting them to the number correct formats in the actual Excel 2007 spreadsheet?


You're right, the 29advancedvaluebinder test isn't working correctly because there is a problem with the AdvancedValueBinder. Numbers, Booleans, Nulls, Formulae and Percentage seem to be OK, as do times; but dates and date/times are failing. And I see that the code doesn't test for numbers like 1.234e-5.
I'll take a look at this and fix it ASAP: it's a fairly straightforward job.

Not sure why your own code isn't working for anything at all with the AdvancedValueBinder. You simply need to ensure that
    PHPExcel_Cell::setValueBinder( new PHPExcel_Cell_AdvancedValueBinder() );

is called before setting your cell values.
Coordinator
Sep 10, 2010 at 12:52 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Sep 10, 2010 at 12:57 PM
Edited Sep 10, 2010 at 1:01 PM

Reposted in above discussion