Conditional formating and Office 2003 compatibility pack

Topics: Developer Forum, User Forum
Mar 5, 2009 at 4:45 PM

I have a problem when I try to open a generated Excel 2007 file on Office 2003 with conditional formating. Excel said to me that my condiotionnal formating style isn't compatible with this version of Excel. I try to set the "setOffice2003Compatibilty" to true, but I have the same result.
Here the code :

$objPHPExcel = new PHPExcel();


$conditional1 = new PHPExcel_Style_Conditional();


$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');

Another thing : I have created a Excel file in Excel with the same conditional formatting and I have saved it to a .xlsx file and that's work...
I have found a difference between the generated and the created file in the style.xml file
Generated file :
    <name val="Calibri"/>
    <sz val="10"/>
    <b val="true"/>
    <u val="none"/>
    <color rgb="FFFFFF00"/>
   <numFmt numFmtId="164" formatCode="General"/>
    <patternFill patternType="none">
     <fgColor rgb="FFFFFFFF"/>
     <bgColor rgb="FF000000"/>
   <alignment horizontal="general" vertical="bottom" textRotation="0"/>
   <border outline="true"/>

Created file :
    <i val="0"/>
    <condense val="0"/>
    <extend val="0"/>
    <color indexed="13"/>

I try to copy-paste the tags from created file to generated file with no success.

How to resolve this problem (if it is possible to resolve it) ?


Mar 5, 2009 at 11:36 PM
We will need Maarten to look at this!