GithubHelp home page GithubHelp logo

Comments (2)

chris114782 avatar chris114782 commented on July 29, 2024

I am aware I could just set the formula in code, but these templates are to be edited by non developers and I'd like to leave as much excel functionality intact as possible, without having to update the code every time a new template is built.

from php-excel-templator.

alhimik1986 avatar alhimik1986 commented on July 29, 2024

Well, you are passing an array to the CellSetter. To find out how many rows to fill, you simply pass the size of this array to the callback function. This will be the number of rows to fill (or maybe number of rows minus one).

If the formula will be edited you can try some solution:
insert a template variable with name like {cell_E2_formula} in D2 cell so the cell could be cloneable. And then add some formula to E2 cell. After that copy the formula from cell E2 using event PhpExcelTemplator::BEFORE_INSERT_PARAMS. And then you need to somehow copy the formula so that there is a relative shift of the cells along the rows (using CellSetter callback). I hope the PHPSpreadsheet could make this.

I'm not sure this will work. It has not been tested. But that's all I can help without modifying the code to solve the problem quickly.

from php-excel-templator.

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.