Excel導(dǎo)出

創(chuàng)建一個(gè)文件,使用第一個(gè)參數(shù)作為文件名。
Excel::create('Filename');
可以使用回調(diào)函數(shù)操作創(chuàng)建的文件。

Excel::create('Filename', function($excel) {

// Call writer methods here

 });

更改屬性
有幾個(gè)屬性可以改變 大多數(shù)設(shè)置了默認(rèn)。

Excel::create('Filename', function($excel) {

// Set the title  設(shè)置標(biāo)題

      $excel->setTitle('Our new awesome title');

// Chain the setters  設(shè)置創(chuàng)作人

       $excel->setCreator('Maatwebsite') ->setCompany('Maatwebsite');

    // Call them separately   設(shè)置 介紹說明

      $excel->setDescription('A demonstration to change the file properties');
});

Exporting導(dǎo)出

To download the created file, use->export($ext) or ->download($ext).

下載創(chuàng)建的excel
Export to Excel5 (xls)格式

Excel::create('Filename', function($excel) {

})->export('xls');
// or

    ->download('xls');

Export to Excel2007 (xlsx)格式

    ->export('xlsx');

// or

    ->download('xlsx');

Export to CSV格式

    ->export('csv');

// or

    ->download('csv');

(未完待續(xù)...)

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容