Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Excel::load('excelrecap.xls', function($excel) use($array) {
- $excel->sheet('Copro', function($sheet) use($array) {
- $sheet->fromArray($array, null, 'A9', false);
- foreach ($sheet as $row) {
- $sheet->setCellValue($row, 'some value');
- }
- });
- })->export('xls');
- array:2 [
- 0 => array:8 [
- "Batiment" => "Unique"
- "N° du lot" => 7
- "Étage" => "1e étage"
- "Fraction" => "Parking 0.35"
- "Surface" => "11.500"
- "Coefficient" => "0.350"
- "Surface pondérée" => "4.025"
- "Quote-part" => "635.961"
- ]
- 1 => array:8 [
- "Batiment" => "Unique"
- "N° du lot" => 8
- "Étage" => "1e étage"
- "Fraction" => "Principal"
- "Surface" => "65.850"
- "Coefficient" => "0.903"
- "Surface pondérée" => "59.265"
- "Quote-part" => "9364.039"
- ]
- ]
- $objPHPExcel->getActiveSheet()->mergeCells('A1:E1');
- // add some text
- $objPHPExcel->getActiveSheet()->setCellValue('A1','The quick brown fox.');
- $objPHPExcel->getActiveSheet()->mergeCells('A1:E3');
- // add some text
- $objPHPExcel->getActiveSheet()->setCellValue('A1','The quick brown fox.');
- $sheet->cells('A1:C1', function($cells) {
- $cells->setBorder('thin', 'thin', 'thin', 'thin');
- });
- $sheet->mergeCells('A1:C1');
Add Comment
Please, Sign In to add comment