Giter VIP home page Giter VIP logo

Comments (9)

janokary avatar janokary commented on May 15, 2024 1

It is fixed. You are super cool.

from fast-excel.

rap2hpoutre avatar rap2hpoutre commented on May 15, 2024 1

Thank you!

from fast-excel.

mrwcjoughin avatar mrwcjoughin commented on May 15, 2024 1

@rap2hpoutre I am using the latest nuget package and it seems this issue is happening again?
if a cell is blank then the cell is not being included in the cells enumeration for that row at all?
how has this regressed if there is a test for it?

from fast-excel.

rap2hpoutre avatar rap2hpoutre commented on May 15, 2024

Thank you for your contribution. Could you please provide a (small) example of an Excel that produce the bug? I could add it to the unit tests and fix the bug!

from fast-excel.

janokary avatar janokary commented on May 15, 2024

When there are nulls values the null cells are skipped (or better missing) end the rest of the line is shifted to the left.

file-3.xlsx

from fast-excel.

rap2hpoutre avatar rap2hpoutre commented on May 15, 2024

I can not reproduce the problem. I tried this but it's OK (no bugs):

$original_collection = collect([
    ['col1' => 'val1', 'col2' => 'val2'],
    ['col1' => null, 'col2' => 'val2'] // <= the "null" value is here. 
]);

$filename = __DIR__ . '/test2.xlsx';

(new FastExcel($original_collection))->export($filename);
$res = (new FastExcel())->import($filename);

$this->assertEquals($original_collection, $res); // <= My unit test is green, success

unlink($filename);

Could you paste a relevant part of your collection (thank you for your time!)?

from fast-excel.

janokary avatar janokary commented on May 15, 2024

this is my example (full of nulls):
code.txt

from fast-excel.

rap2hpoutre avatar rap2hpoutre commented on May 15, 2024

Thank you! Fixed via b8f3fec, available in v0.4.0 (just update your version with composer and it should work!). Let me know if something went wrong!

from fast-excel.

rap2hpoutre avatar rap2hpoutre commented on May 15, 2024

Also, I added a unit test with your case, thanks to you:

public function testIssue32()
{
$original_collection = collect([
[
'duration_in_months' => 1,
'expires_at' => '2018-08-06',
],
[
'duration_in_months' => null,
'expires_at' => '1970-01-01',
],
]);
(new FastExcel(clone $original_collection))->export(__DIR__.'/test2.xlsx');
$res = (new FastExcel())->import(__DIR__.'/test2.xlsx');
$this->assertEquals($original_collection[1], $res[1]);
unlink(__DIR__.'/test2.xlsx');
}

from fast-excel.

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.