{"action":"created","issue":{"url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/117","repository_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet","labels_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/117/labels{/name}","comments_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/117/comments","events_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/117/events","html_url":"https://github.com/PHPOffice/PhpSpreadsheet/issues/117","id":214355497,"number":117,"title":"Creating file from template, formatting changed","user":{"login":"ajaxovic","id":11288002,"avatar_url":"https://avatars0.githubusercontent.com/u/11288002?v=3","gravatar_id":"","url":"https://api.github.com/users/ajaxovic","html_url":"https://github.com/ajaxovic","followers_url":"https://api.github.com/users/ajaxovic/followers","following_url":"https://api.github.com/users/ajaxovic/following{/other_user}","gists_url":"https://api.github.com/users/ajaxovic/gists{/gist_id}","starred_url":"https://api.github.com/users/ajaxovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajaxovic/subscriptions","organizations_url":"https://api.github.com/users/ajaxovic/orgs","repos_url":"https://api.github.com/users/ajaxovic/repos","events_url":"https://api.github.com/users/ajaxovic/events{/privacy}","received_events_url":"https://api.github.com/users/ajaxovic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-15T11:06:19Z","updated_at":"2017-03-15T14:09:08Z","closed_at":null,"body":"I have simple template with cell and conditional formatting (see attachment). Cells E4 and E5 are formatted as percentage, cells F4 and E5 are currency. Now, I run this code:\r\n\r\n```\r\n$sheet = \\PhpOffice\\PhpSpreadsheet\\IOFactory::load(__DIR__ . '/template.xltx');\r\n$sheet->setActiveSheetIndex(0);\r\n\r\n$activeSheet = $sheet->getActiveSheet();\r\n$activeSheet->setCellValueExplicit('B4', number_format(126852.36, 2, '.', ''), \\PhpOffice\\PhpSpreadsheet\\Cell\\DataType::TYPE_NUMERIC);\r\n$activeSheet->setCellValueExplicit('B5', number_format(33525555.2, 2, '.', ''), \\PhpOffice\\PhpSpreadsheet\\Cell\\DataType::TYPE_NUMERIC);\r\n\r\n$writer = new \\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx($sheet);\r\n$writer->save(__DIR__ . '/output.xlsx');\r\n```\r\n\r\nWhen I open `output.xlsx`, Cells E4:F5 are not formatted as in template and I can't change them to right format I don't know why. Tested in Excel 2010. Libre office are OK. \r\n\r\n[files.zip](https://github.com/PHPOffice/PhpSpreadsheet/files/844176/files.zip)\r\n"},"comment":{"url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/comments/286752360","html_url":"https://github.com/PHPOffice/PhpSpreadsheet/issues/117#issuecomment-286752360","issue_url":"https://api.github.com/repos/PHPOffice/PhpSpreadsheet/issues/117","id":286752360,"user":{"login":"ajaxovic","id":11288002,"avatar_url":"https://avatars0.githubusercontent.com/u/11288002?v=3","gravatar_id":"","url":"https://api.github.com/users/ajaxovic","html_url":"https://github.com/ajaxovic","followers_url":"https://api.github.com/users/ajaxovic/followers","following_url":"https://api.github.com/users/ajaxovic/following{/other_user}","gists_url":"https://api.github.com/users/ajaxovic/gists{/gist_id}","starred_url":"https://api.github.com/users/ajaxovic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ajaxovic/subscriptions","organizations_url":"https://api.github.com/users/ajaxovic/orgs","repos_url":"https://api.github.com/users/ajaxovic/repos","events_url":"https://api.github.com/users/ajaxovic/events{/privacy}","received_events_url":"https://api.github.com/users/ajaxovic/received_events","type":"User","site_admin":false},"created_at":"2017-03-15T14:09:08Z","updated_at":"2017-03-15T14:09:08Z","body":"If you mean format string, so, PhpSpreadsheet's answer for both files:\r\nE4: 0%\r\nF4: #,##0.00\\ \"Kč\"\r\n\r\nBut as I said, Excel 2000 does not see it. I did some more tests and problem is conditional formatting. If I create new template without conditional formatting, everything works...\r\n\r\n\r\n"}}
{"actor":{"display_login":"ajaxovic"}}