
Security News
Socket Integrates With Bun 1.3’s Security Scanner API
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
xls-report-ex
Advanced tools
Поддерживаемые файлы: xlsx
Поддерживается 2 вида выражений:
{{value|pipe:arg1:argN}}
[[value|pipe:arg1:argN]]
Где:
value
- некоторое значение или массивpipe
- некоторая функция дополнительной обработки значенияarg1
, argN
- агрументы/параметры передаваемые в функцию обработки значения{{propertyName}}
- вывод значения без обработки
{{propertyName|date}}
- значение форматируется как дата
{{fileName|image}}
- производится поиск картинки по имени файла.
Если картинка найдена, то она встраивается в ячейку таблицы
{{propertyArrayName|find:propertyName:propertyValue}}
- поиск объекта в массиве propertyArrayName
у которого есть свойство propertyName
равное propertyValue
{{propertyObjectName|get:propertyName}}
- возвращает значение свойства propertyArrayName
из объекта propertyObjectName
[[array|repeat-rows:3]]
- обрабатать массив переменных и
вывести его содержимое в секцию из 3 строк начиная с текущей.
Строки будут продублированы в соответствии с размером массива.
[[array|filter:propertyName:checkValue]]
- отфильтровать массив.
Если указано только propertyName
, то на выходе получим массив с объектами содержащими это поле.
Если указано propertyName
и checkValue
, то на выходе получим массив с объектами которые содержат
свойство propertyName
равное checkValue
.
Будем выводить в шаблонизаторе такие данные:
let data = {
reportBuildDate: 1526443275041,
results: [
{ text: 'some text 1', answerText: 'a text of an answer 1'},
{ text: 'some text 2', answerText: 'a text of an answer 2'},
{ text: 'some text 3', answerText: 'a text of an answer 3'},
{ answerText: 'a text of an answer 3'},
],
};
Составим шаблон:
!!! В данном примере / указано вместо |
A | B |
---|---|
{{reportBuildDate/date}} | {{results/find:text:some text 2/get:answerText}} |
[[results/filter:text/repeat-rows:1]] {{text}} | {{answerText}} |
Получим результат:
A | B |
---|---|
16.05.2018 | a text of an answer 2 |
some text 1 | a text of an answer 1 |
some text 2 | a text of an answer 2 |
some text 3 | a text of an answer 3 |
FAQs
The template engine for generate xlsx documents
We found that xls-report-ex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket now integrates with Bun 1.3’s Security Scanner API to block risky packages at install time and enforce your organization’s policies in local dev and CI.
Security News
Python 3.14 adds template strings, deferred annotations, and subinterpreters, plus free-threaded mode, an experimental JIT, and Sigstore verification.
Security News
Former RubyGems maintainers have launched The Gem Cooperative, a new community-run project aimed at rebuilding open governance in the Ruby ecosystem.