我正在尝试从 A1 开始 wraptext ,但它不起作用并抛出错误 getStyle 方法未找到
Excel::create('complaint_report', function ($excel) use ($compsArray) {
// Set the spreadsheet title, creator, and description
$excel->setTitle('complaints report');
$excel->setCreator('Laravel')->setCompany('Beegains, LLC');
$excel->setDescription('complaints file');
// Build the spreadsheet, passing in the comps array
$excel->sheet('sheet1', function ($sheet) use ($compsArray) {
$sheet->fromArray($compsArray, null,getStyle('A1')->getAlignment()->setWrapText(true), false, false);
});
})->download('xlsx');
您不能在getStyle
工作表上调用该函数。只需更新为:
$sheet->fromArray($compsArray, null, 'A1', false, false)
->getStyle('A1')
->getAlignment()
->setWrapText(true);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句