Comments (2)
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.
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)
- Small bug fix - BEFORE_SAVE proposal
- how can I use the template not from a file, but from DB blob field? HOT 1
- PhpSpreadsheet introduced a breaking change in 1.13.0 HOT 3
- Comments in english HOT 1
- Double header : open in 2 times with firefox 77.0.0 HOT 1
- No graph saved HOT 1
- [feature] Allow export graph HOT 2
- too many rows HOT 4
- Группировка строк и/или колонок
- Generate the result within the brackets []
- Загрузка изображений в ячейку. HOT 1
- Заполнение статичных данных в таблице. HOT 4
- Добавление символов в ячейку шаблона с идентификатором массива HOT 1
- Invalid cell coordinate A-1 at HOT 5
- Cells pushed down after first table
- Formula cells have their contents changed
- Изменить высоту всего ряда в зависимости от значения в ячейке HOT 2
- Вставляются пустые строки HOT 3
- После сохранения файла эксель восстанавливает ошибки HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-excel-templator.