Guest User

Untitled

a guest
Jan 18th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.26 KB | None | 0 0
  1. Excel::load('excelrecap.xls', function($excel) use($array) {
  2.  
  3. $excel->sheet('Copro', function($sheet) use($array) {
  4.  
  5. $sheet->fromArray($array, null, 'A9', false);
  6. foreach ($sheet as $row) {
  7. $sheet->setCellValue($row, 'some value');
  8. }
  9. });
  10.  
  11. })->export('xls');
  12.  
  13. array:2 [
  14. 0 => array:8 [
  15. "Batiment" => "Unique"
  16. "N° du lot" => 7
  17. "Étage" => "1e étage"
  18. "Fraction" => "Parking 0.35"
  19. "Surface" => "11.500"
  20. "Coefficient" => "0.350"
  21. "Surface pondérée" => "4.025"
  22. "Quote-part" => "635.961"
  23. ]
  24. 1 => array:8 [
  25. "Batiment" => "Unique"
  26. "N° du lot" => 8
  27. "Étage" => "1e étage"
  28. "Fraction" => "Principal"
  29. "Surface" => "65.850"
  30. "Coefficient" => "0.903"
  31. "Surface pondérée" => "59.265"
  32. "Quote-part" => "9364.039"
  33. ]
  34. ]
  35.  
  36. $objPHPExcel->getActiveSheet()->mergeCells('A1:E1');
  37.  
  38. // add some text
  39. $objPHPExcel->getActiveSheet()->setCellValue('A1','The quick brown fox.');
  40.  
  41. $objPHPExcel->getActiveSheet()->mergeCells('A1:E3');
  42.  
  43. // add some text
  44. $objPHPExcel->getActiveSheet()->setCellValue('A1','The quick brown fox.');
  45.  
  46. $sheet->cells('A1:C1', function($cells) {
  47. $cells->setBorder('thin', 'thin', 'thin', 'thin');
  48. });
  49. $sheet->mergeCells('A1:C1');
Add Comment
Please, Sign In to add comment