我正在尝试将图纸的方向导出到全屏,同时将其导出为pdf。这是我的代码
Excel::create('Benchmark Constituents', function($excel) use ($Array_data) {
$excel->setTitle('Benchmark Constituents');
$excel->setDescription('File containing Benchmark Constituents');
$excel->sheet('sheet1', function($sheet) use ($Array_data) {
$sheet->setOrientation('landscape');
$sheet->mergeCells('E1:G1');
$sheet->cell('E1', function($cell) {
$cell->setValue('Benchmark Constituents');
$cell->setAlignment('center');
$cell->setFontColor('#ffffff');
$cell->setBackground('##000000');
$cell->setFont(array(
'family' => 'Calibri',
'size' => '16',
'bold' => true
));
});
$sheet->fromArray($Array_data, null,"A3",true);
$sheet->row(3, function($row) {
$row->setBackground('#808080');
$row->setFontColor('#ffffff');
});
$sheet->row(1, function($row) {
$row->setBorder('none');
});
$sheet->row(2, function($row) {
$row->setBorder('none');
});
});
})->download('pdf');
我将此文件作为输出获取,因为页面宽度导致某些表列被隐藏: