What is the pb?
Dec 16, 2020
10
Level 13
how to Excel file export with client name?
hello guys i want to export my excel file with client name its dynamic so how to do it?
here is my code
Excel::create(config('constants.scripts-new-name.'.$script_id),
function($excel) use ($excelArray,$state,$language,$finalArr) {
if(isset($excelArray) && count($excelArray) >0)
{
$excel->sheet($state." ".strtoupper($language), function($sheet) use ($excelArray)
{
$sheet->fromArray($excelArray);
$sheet->setWidth(array(
'A' => 80,
'B' => 10,
'C' => 10,
'D' => 20,
'E' => 30
));
});
}
foreach($finalArr as $k => $v)
{
$excel->sheet(strtoupper($k), function($sheet) use ($v)
{
$sheet->fromArray($v);
$sheet->setWidth(array(
'A' => 80,
'B' => 20,
'C' => 10,
'D' => 20,
'E' => 30
));
});
}
})
->download("xlsx");
Level 102
Do you mean the file name?
Excel::create($clientModel->name,
1 like
Please or to participate in this conversation.