yajra / laravel-datatables-buttons

Laravel DataTables Buttons Plugin
https://yajrabox.com/docs/laravel-datatables/buttons-installation
MIT License
254 stars 53 forks source link

updating the excel in the package #75

Closed rylxes closed 2 years ago

rylxes commented 6 years ago

i just did composer require maatwebsite/excel on my application , and i got this error message

Your requirements could not be resolved to an installable set of packages.

Problem 1

i think the excel package for this plugin is outdated : Application Parameters : "laravel/framework": "5.6.*", "yajra/laravel-datatables-buttons": "^3.0",

schonhoff commented 6 years ago

Hey,

you need to install the ^4.0 version of "yajra/laravel-datatables-buttons to get maatwebsite/excel ^3.0 running.

https://github.com/yajra/laravel-datatables-buttons/issues/68 https://github.com/yajra/laravel-datatables-buttons/blob/4.0/CHANGELOG.md#v400---08-15-2018

oranges13 commented 5 years ago

Anyone else having this issue, you can update both packages at once to the newest versions composer require maatwebsite/excel yajra/laravel-datatables-buttons

mikizdr commented 5 years ago

Hi I'm using next packages in my app:

"laravel/framework": "5.8.*", "maatwebsite/excel": "^3.1", "phpoffice/phpspreadsheet": "^1.6", "yajra/laravel-datatables-oracle": "~9.0"

When start using yajra, I faced the problem with importing excel data. I noticed there is some conflict between excel and yajra but don't know if there is solution for that

schonhoff commented 5 years ago

Hi,

did you try to import some boolean values? I implemented a nova import card and had some problems with boolean values. Yajra is using maatwebsite excel and their importer is quite "buggy" in my opinion. Boolean values are difficult for them to handle. Maybe that is the case on your problem.

Do you can offer more specific information? Maybe we can help you.

mikizdr commented 5 years ago

HI,

thanks for the reply. I'm importing Excel file with several sheets. They are chunked in some sizes and send to the queue as job. Everything went fine until I started to use Yajra. This is some part of a huuuuge log:

App\Http\Controllers\Import\CpImportController one week import error: Error while sending STMT_EXECUTE packet. PID=14256 (SQL: insert into jobs (queue, attempts, reserved_at, available_at, created_at, payload) values (default, 0, ?, 1558075209, 1558075209, {"displayName":"Maatwebsite\Excel\Jobs\QueueImport","job":"Illuminate\Queue\CallQueuedHandler@call","maxTries":null,"delay":null,"timeout":null,"timeoutAt":null,"data":{"commandName":"Maatwebsite\Excel\Jobs\QueueImport","command":"O:34:\"Maatwebsite\Excel\Jobs\QueueImport\":6:{s:10:\"connection\";N;s:5:\"queue\";N;s:15:\"chainConnection\";N;s:10:\"chainQueue\";N;s:5:\"delay\";N;s:7:\"chained\";a:26231:{i:0;s:1593:\"O:32:\"Maatwebsite\Excel\Jobs\ReadChunk\":14:{s:40:\"\u0000Maatwebsite\Excel\Jobs\ReadChunk\u0000import\";O:34:\"App\Imports\MainOneWeekSalesImport\":2:{s:12:\"\u0000\u0000themeType\";s:9:\"Wallpaper\";s:7:\"\u0000\u0000year\";s:4:\"2019\";}s:40:\"\u0000Maatwebsite\Excel\Jobs\ReadChunk\u0000reader\";O:36:\"PhpOffice\PhpSpreadsheet\Reader\Xlsx\":8:

So the main problem is to send job to the queue. I'm using with WithChunkReading and ShouldQueue concerns.

Let me know if you need some specific information about the code.

schonhoff commented 5 years ago

One Question to your error message: Shouldn't the 'reserved_at' be a timestamp? You are inserting a '?'. Maybe that is the error? That would be my first suggestion.

mikizdr commented 5 years ago

This is default Laravel jobs table: `

id int(10) UN AI PK
queue varchar(191)
payload longtext
attempts tinyint(3) UN
reserved_at int(10) UN
available_at int(10) UN
created_at int(10) UN

` Last three columns are integer and they store seconds as unix epoch time..

schonhoff commented 5 years ago

I know but you try to store an ? in an integer column: insert into jobs (queue, attempts, reserved_at, available_at, created_at, payload) values (default, 0, ?, 1558075209, 1558075209,

The third parameter on your values is an '?' (char) instead an integer. Maybe that helps you to find the error.

mikizdr commented 5 years ago

Hi I found the reason, actually I found what is the reason. Excel spreadsheet I'm trying to import has 6 sheets X ~ 3K rows. When I remove one sheet, it goes without a problem. So it suppose this is not related to Yajra but to payload for jobs table. But I must find what.

mikizdr commented 5 years ago

This was the reason ( I hope) max_allowed_packet = 128M