spout icon indicating copy to clipboard operation
spout copied to clipboard

Add formula functionality in v3.3.0

Open davidbonting opened this issue 3 years ago • 2 comments

Since this package doesn't support formula's.

5 years ago there was a try #425 and 3 years ago too #612. Sadly they were never merged and the package has changed so the code doesn't work anymore.

I liked the idea of #425 more then #612, so I just used that one as reference. If anyone wants to use my code (since this PR will probably never be merged) here's what you got to do:

{ 
...
 "repositories": [
        {
            "type": "git",
            "url": "https://github.com/davidbonting/spout.git"
        }
    ],
 "require": {
      "box/spout": "master"
      ...
 }
}

And in the code:

 // This will show empty if in preview mode
$rowFromValues = WriterEntityFactory::createRowFromArray(['Total', '=SUM(E2:E3)']);

// This will show a cached value (120) if in preview mode
$rowFromValues = WriterEntityFactory::createRowFromArray(['Total', ['=SUM(E2:E3)', 120]]);

davidbonting avatar Feb 21 '22 12:02 davidbonting

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar Feb 21 '22 12:02 CLAassistant

Merged a variation in https://github.com/openspout/openspout/pull/5

Slamdunk avatar Mar 02 '22 09:03 Slamdunk