Excel reports generating library
courseorchestra / xylophone Goto Github PK
View Code? Open in Web Editor NEWExcel reports generating library
Home Page: https://courseorchestra.github.io/xylophone/
License: GNU Lesser General Public License v3.0
Excel reports generating library
Home Page: https://courseorchestra.github.io/xylophone/
License: GNU Lesser General Public License v3.0
Excel reports generating library
(и, вероятно, лишняя проверка для столбцов)
При использовании библиотеки столкнулся с проблемой копирования лишних строк. Пример данных для теста прилагаю.
Проблема оказалась в POIReportWriter
: при вычислении rowFinish
берется максимум из значений, которые обозначают разные вещи — номер строки в шаблоне и номер последней строки результата на текущей итерации. И дальше значение интерпретируется как номер строки в шаблоне. В результате с ростом числа строк в формирующемся документе растет число скопированных строк, и может быть скопировано больше, чем нужно.
Из лога изменений не понял, откуда там максимум появился, но тестов на это, видимо, нет, потому что изменение на номер строки в шаблоне:
int rowFinish = range.bottom();
исправило проблему на моем примере и не уронило тесты.
Дальше по коду аналогичный выбор для столбцов, но минимума. Он кажется избыточным, дальше проверка на null
есть, так что вероятно достаточно будет (также не влияет на тесты):
int colFinish = range.right();
Кстати, спасибо за библиотеку, пригодилась. :)
Merge in multisheet reports is done only on the last sheet.
This applies both to:
replace getCellType
for getCellTypeEnum
to avoid using deprecated API
At the moment, output
tag initiates a call to ReportWriter.putSection
. This method copies a section of template to result, substituting placeholders inside cells.
We need additional map
tag inside output
, that should look like this:
<output range="A3:B5">
<map cell="A4"> <!-- cell address should lie inside the parent's range,
otherwise throw an error during descriptor parsing -->
foo~{@bar} <!--syntax is as usual in template-->
</map>
</output>
After normal putSection
execution, we should also iterate over all map
tags, and set all the values in the appropriate result cells.
The rationale for this is as following:
<map>
functionality with more options, such as dynamically setting foreground/background colours etc.As shown in documentation,
element
tag only output
or iteration
are allowed,iteration
tag only element
tags are allowed.If we have something like <iteration><iteration>
or <element><element>
, no informative error is shown to user, but descriptor parsing may fail.
Hello!
Is it possible to apply conditional formatting for created Excel document?
I'm tried to add conditional formatting to Excel template, but it did not apply in the output file.
Or is it impossible?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.