Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check total rows before Queue import to Model #2317

Closed
4 tasks done
makproductions opened this issue Aug 5, 2019 · 7 comments
Closed
4 tasks done

Check total rows before Queue import to Model #2317

makproductions opened this issue Aug 5, 2019 · 7 comments
Labels

Comments

@makproductions
Copy link

makproductions commented Aug 5, 2019

Prerequisites

Versions

PHP version: 7.1.9-1+ubuntu16.04.1+deb.sury.org+1
Laravel version: 5.8.24
Package version: 3.1.15

Description

Is it possible to check how many total rows there are in the CSV file to be imported to Model.
I want to know how many rows are going to be imported before the queue.

$partDetailsImport = new PartDetailsImport();
Excel::queueImport($partDetailsImport, $file);

Or can i check the total number of rows to be imported by adding a function to the PartDetailsImport class ?

Is this achievable ?

Thank you

@ghost
Copy link

ghost commented Aug 5, 2019

Thanks for submitting the ticket. Unfortunately the information you provided is incomplete. We need to know which version you use and how to reproduce it. Please include code examples. Before we can pick it up, please check (https://github.com/Maatwebsite/Laravel-Excel/blob/3.1/.github/ISSUE_TEMPLATE.md) and add the missing information. To make processing of this ticket a lot easier, please make sure to check (https://laravel-excel.maatwebsite.nl/3.1/getting-started/contributing.html) and double-check if you have filled in the issue template correctly. This will allow us to pick up your ticket more efficiently. Issues that follow the guidelines correctly will get priority over other issues.

@ghost ghost removed the more information needed label Aug 5, 2019
@GlennM
Copy link
Contributor

GlennM commented Aug 5, 2019

See #1903 and
https://phpoffice.github.io/PhpSpreadsheet/master/PhpOffice/PhpSpreadsheet/Worksheet/Worksheet.html#method_getHighestRow
as a starting point.

#1880 / Docs could also work, but in that case you'd only have the count AFTER the import.

@makproductions
Copy link
Author

Hey @GlennM ,

Im not too sure how i can go about using the PHPspreadsheet function of getHighestRow.
Could you please help with an example ??

Would really appreciate it ! thank you

@jochemfuchs
Copy link
Contributor

Take a look at https://docs.laravel-excel.com/3.1/imports/extending.html
You can hook into the eventsm the use getDelegate() to access PHPSpreadsheet.

@rashed50702
Copy link

rashed50702 commented Aug 31, 2019

I am facing a problem with rows null value during import the excel file. Would someone have a look into my problem please - https://stackoverflow.com/q/57738878/7014431

@GlennM
Copy link
Contributor

GlennM commented Sep 1, 2019

@rashed50702 Please open a new issue (and use the template). "Hijacking" another topic is not the way support works. There are some replies on Stackoverflow at the moment, please check those first...

@GlennM GlennM closed this as completed Sep 1, 2019
@nguyenanhthai
Copy link

Any solution for this issue? I have tried static variable to count, but still not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants