Git Product home page Git Product logo

Comments (8)

adrilo avatar adrilo commented on May 18, 2024

Hi @DVendy,
Can you try 2 things to narrow down the issue?

  1. Change the location of the XLSX to make sure it can still be read
  2. Downgrade to version 1.0.7 (change composer.json: "box/spout": "1.0.7". I changed the way files are read on Windows, it may have broken the reader in some configurations.

from spout.

DVendy avatar DVendy commented on May 18, 2024

Tried both, still failed ...

from spout.

area722 avatar area722 commented on May 18, 2024

i have the same problem also tried the things adrilo sugested

from spout.

area722 avatar area722 commented on May 18, 2024

found this issue.. i was trying to read a .xls and this library only works with .xlsx

from spout.

adrilo avatar adrilo commented on May 18, 2024

@area722 Spout only works with XLSX files, sorry.
@DVendy, can you please share some code? If both solutions did not work, I'm not sure why it failed...

from spout.

DVendy avatar DVendy commented on May 18, 2024
public function import_spout(){     
    $reader = ReaderFactory::create(Type::XLSX);
    $reader->open("data.xlsx");

    while ($reader->hasNextSheet()) {
        $reader->nextSheet();

        while ($reader->hasNextRow()) {
            $row = $reader->nextRow();
            var_dump($row);
        }
    }

    $reader->close();
}

Just like in documentation.
Oh yes and I used it in Laravel framework. Is there any extra configuration for laravel?

from spout.

DVendy avatar DVendy commented on May 18, 2024

The writer working flawlessly btw., :3

from spout.

adrilo avatar adrilo commented on May 18, 2024

Just to be sure, when you downgraded Spout to 1.0.7, did you run composer update to update the source files?
Given the file path you mentioned, it seems like you are using Windows. And I made a change for Windows in the 1.0.8 version so it's really likely to be the cause of your problem.

If you've already done that, can you tell me which version of PHP you're using and if you are using WAMP/XAMPP. Also, if the file does not contain any sensitive data, would you mind sending it to me at adrien [at] box.com? It will help for debugging!

I'm not familiar with Laravel, but there should not be any additional configuration (and the writer works)

from spout.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.