webman有没有Excel插件呀

wskgmy520

webman有没有Excel插件呀,用到导出Excel文件

2362 6 4
6个回答

owenzhang

你看看老夫的笔记,PhpOffice/PhpSpreadsheet
https://cloud.tencent.com/developer/article/1929157

  • 暂无评论
xiuwang

手册不是有么

  • wskgmy520 2022-07-15

    那个手册的不能用。生成的Excel文件不能下载
    {
    "code": 500,
    "msg": "fopen(E:\apiweb\public/hello_world.xlsx): failed to open stream: Resource temporarily unavailable",
    "traces": "ErrorException: fopen(E:\apiweb\public/hello_world.xlsx): failed to open stream: Resource temporarily unavailable in E:\apiweb\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\BaseWriter.php:125\nStack trace:\n#0 [internal function]: {closure}(2, 'fopen(E:\\apiweb...', 'E:\\apiweb\\vendo...', 125, Array)\n#1 E:\apiweb\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\BaseWriter.php(125): fopen('E:\\apiweb\\publi...', 'wb')\n#2 E:\apiweb\vendor\phpoffice\phpspreadsheet\src\PhpSpreadsheet\Writer\Xlsx.php(539): PhpOffice\PhpSpreadsheet\Writer\BaseWriter->openFileHandle('E:\\apiweb\\publi...')\n#3 E:\apiweb\app\controller\Index.php(45): PhpOffice\PhpSpreadsheet\Writer\Xlsx->save('E:\\apiweb\\publi...')\n#4 E:\apiweb\vendor\workerman\webman-framework\src\App.php(135): app\controller\Index->post(Object(support\Request))\n#5 E:\apiweb\vendor\workerman\workerman\Connection\TcpConnection.php(638): Webman\App->onMessage(Object(Workerman\Connection\TcpConnection), Object(support\Request))\n#6 E:\apiweb\vendor\workerman\workerman\Events\Select.php(295): Workerman\Connection\TcpConnection->baseRead(Resource id #145)\n#7 E:\apiweb\vendor\workerman\workerman\Worker.php(2437): Workerman\Events\Select->loop()\n#8 E:\apiweb\vendor\workerman\workerman\Worker.php(1432): Workerman\Worker->run()\n#9 E:\apiweb\vendor\workerman\workerman\Worker.php(1375): Workerman\Worker::forkWorkersForWindows()\n#10 E:\apiweb\vendor\workerman\workerman\Worker.php(550): Workerman\Worker::forkWorkers()\n#11 E:\apiweb\start.php(117): Workerman\Worker::runAll()\n#12 {main}"
    }

ontheway

我测试手册的例子,是可以生成和导出的
https://www.workerman.net/doc/webman/components/excel.html

  • wskgmy520 2022-07-16

    return response()->download($file_path, '文件名.xlsx'); 用了这插件有生成了文件, 但是点击的时候怎么同时下载出来? 只有生成。不会下载

ontheway

如果要导出大量数据,如上万条可以使用xlswriter,我测试过,字段大概20个,数据量10万,导出时间大概10秒,性能非常好

yzh52521

我使用的 这个 dcat/easy-excel

  • 暂无评论
不败少龙

扩展还是很多的 直接用

  • 暂无评论
年代过于久远,无法发表回答
×
🔝