I have a code like this, this code print a date at A:A.
$file_name = 'Forecast Accuracy Standards_'.date('Y_m_d_').time();
Excel::create($file_name , function ($excel) use ($fasmodules, $data) {
$excel->sheet('Sheet 1', function ($sheet) use ($fasmodules, $data) {
$sheet->cells('A1', function($cells) {
$cells->setValue('Date');
});
$sheet->cells('B1', function($cells) {
$cells->setValue('FPE');
});
$ctr=2;
foreach($fasmodules as $fas){
$sheet->appendRow($ctr, array(
date('m/d/Y',strtotime($fas->date)), $fas->fpe
));
$ctr = $ctr + 1;
}});
})->export('xls');
After printing it I wan't the date set to text to column cause, My formula like this not working.
$sheet->cells('E6', function($cells) {
$jan_start = "01/01/2017";
$jan_end = "01/30/2018";<=12/27/18")
$cells->setValue('=SUMIFS(B1:B5807,A1:A5807,">=12/27/17",A1:A5807,"<=12/27/18")');
});
Also please some one answer this ticket: Laravel 5.4 Maatwebsite Excel set column format to number
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire