-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove jasper reports and replace with PHPWord/libreoffice #1341
Conversation
d721bdc
to
f824192
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
part of me also wants to see if we can find something a little "smaller" than libreoffice to do the doc to pdf conversion. Since libreoffice brings in A LOT more, but that can also be done at a future date.
@@ -15,7 +15,7 @@ Requires: httpd | |||
Requires: mariadb >= 5.5.3 | |||
Requires: php >= 5.4 php-cli php-mysql php-pdo php-gd php-xml php-mbstring | |||
Requires: php-pear-MDB2 php-pear-MDB2-Driver-mysql php-pecl-apcu | |||
Requires: java-1.8.0-openjdk java-1.8.0-openjdk-devel | |||
Requires: libreoffice |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change to libreoffice-writer
as per bpless code review. (this saves about 15 MB on the image size).
Description
Switch to using PHPWord to generate the reports. This outputs reliably in Word doc format, but the pdf format is lacking so LibreOffice is used to generate the pdf outputs.
This change attempts to produce visually identical reports as before, although the internal file layout is changed. The Jasper reports stuff used one giant table per page. This causes word to report errors when trying to print the report and also causes problems with chart images being truncated when there are long subtitle strings. This version uses the header and footer of the doc (the Jasper reports just has a table row at the top and one at the bottom). The layout is done using paragraph styles so the output word doc is actually easily editable.
The report generation for word docs is significantly faster on my docker instance. The pdf export seems to be about the same.
Motivation
This backend should give us the flexibility to easily produce advanced reports that include tabular information and are not just limited to 1/2 charts per page.
The hardcoded layout stuff is all in the
Reports/ClassicReport.php
class. The idea would be to keep this around for the time being then deprecate it when we have the improved reporting infrastructure,