rap2hpoutre / fast-excel

🦉 Fast Excel import/export for Laravel
MIT License
2.1k stars 246 forks source link

Error exporting large data #271

Open yakhyomus opened 2 years ago

yakhyomus commented 2 years ago

Php version 7.4 Laravel 8

Error message: Trying to add a value that exceeds the maximum number of characters allowed in a cell (32,767)

Table Products with 230 000 data.

function usersGenerator() { set_time_limit(7200); $products = Product::cursor(); foreach ($products as $product) { yield $product; } } return (new FastExcel(usersGenerator()))->export('test.xlsx');

How can i solve this error?

yakhyomus commented 2 years ago

How i solve this error: Just comment: vendor/box/spout/src/Spout/Writer/XLSX/Manager/WorksheetManager.php 272 line //throw new InvalidArgumentException('Trying to add a value that exceeds the maximum number of characters allowed in a cell (32,767)');

StefanoTesla commented 2 years ago

Did you solve a problem introducing another probably problem, did you tried to dump the cells that exceed the 32767 characters? What inside?

yakhyomus commented 2 years ago

Did you solve a problem introducing another probably problem, did you tried to dump the cells that exceed the 32767 characters? What inside?

You were right, inside was big data. I shortened it and problem solved