{"action":"created","issue":{"url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1011","repository_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel","labels_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1011/labels{/name}","comments_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1011/comments","events_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1011/events","html_url":"https://github.com/Maatwebsite/Laravel-Excel/issues/1011","id":193450675,"number":1011,"title":"getHighestRow when creating excel sheet from view.","user":{"login":"gsc89","id":1032459,"avatar_url":"https://avatars.githubusercontent.com/u/1032459?v=3","gravatar_id":"","url":"https://api.github.com/users/gsc89","html_url":"https://github.com/gsc89","followers_url":"https://api.github.com/users/gsc89/followers","following_url":"https://api.github.com/users/gsc89/following{/other_user}","gists_url":"https://api.github.com/users/gsc89/gists{/gist_id}","starred_url":"https://api.github.com/users/gsc89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsc89/subscriptions","organizations_url":"https://api.github.com/users/gsc89/orgs","repos_url":"https://api.github.com/users/gsc89/repos","events_url":"https://api.github.com/users/gsc89/events{/privacy}","received_events_url":"https://api.github.com/users/gsc89/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-05T09:42:22Z","updated_at":"2016-12-05T13:05:54Z","closed_at":null,"body":"\r\n\r\n### Package version, Laravel version\r\nLaravel 5.2\r\n\"maatwebsite/excel\": \"^2.0\",\r\n\r\n### Expected behaviour\r\nGiving the highest row number\r\n\r\n### Actual behaviour\r\nresults in 1 when used like: \r\n\r\n```\r\n Excel::create('JobReport' . date('d-m-Y-h-i-s'),\r\n            function ($excel) use ($job, $customer, $boat, $list) {\r\n                $excel->sheet('ItemList', function ($sheet) use ($job, $customer, $boat, $list) {\r\n                    $sheet->loadView('jobs.export.excel-invoice', array(\r\n                        'list'     => $list,\r\n                        'job'      => $job,\r\n                        'customer' => $customer,\r\n                        'boat'     => $boat\r\n                    ));\r\n                    $highestRow = $sheet->getHighestRow();\r\n\r\n                    dd($highestRow);        // = 1\r\n\r\n                    $sheet->getStyle('C7:C5000')\r\n                        ->getNumberFormat()\r\n                        ->setFormatCode('\"£\"#,##0.00_-');\r\n\r\n                    dd($highestRow);        // = 5000\r\n\r\n                });\r\n            })->download('xlsx');\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/comments/264849155","html_url":"https://github.com/Maatwebsite/Laravel-Excel/issues/1011#issuecomment-264849155","issue_url":"https://api.github.com/repos/Maatwebsite/Laravel-Excel/issues/1011","id":264849155,"user":{"login":"gsc89","id":1032459,"avatar_url":"https://avatars.githubusercontent.com/u/1032459?v=3","gravatar_id":"","url":"https://api.github.com/users/gsc89","html_url":"https://github.com/gsc89","followers_url":"https://api.github.com/users/gsc89/followers","following_url":"https://api.github.com/users/gsc89/following{/other_user}","gists_url":"https://api.github.com/users/gsc89/gists{/gist_id}","starred_url":"https://api.github.com/users/gsc89/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gsc89/subscriptions","organizations_url":"https://api.github.com/users/gsc89/orgs","repos_url":"https://api.github.com/users/gsc89/repos","events_url":"https://api.github.com/users/gsc89/events{/privacy}","received_events_url":"https://api.github.com/users/gsc89/received_events","type":"User","site_admin":false},"created_at":"2016-12-05T13:05:54Z","updated_at":"2016-12-05T13:05:54Z","body":"The only thing I can think of is to either keep a count var in the view file and increment it as a row is added but this wouldn't be usable outside of the view file.\r\n\r\nOtherwise I will need to save the excel sheet as a file locally then re-open the saved file to do anything I needed the row count for. \r\n\r\nBit annoying either way really. "}}
{"actor":{"display_login":"gsc89"}}