Releases: zboszor/OpenCReports
0.8.8: More compatibility fixes. This time it's PHPersonal.
As my development machine was upgraded over the years, support for older PHP versions was lost, despite the promise that it would support PHP 7.0 or newer.
This release restores support for these and adds support for PHP versions that were not working before and were feasible to add.
This includes PHP 5.4 and up. PHP 5.4 was tested on Amazon Linux 2, PHP 5.6 was tested on Fedora 24. [1]
This inevitably brought in some (incompatible) changes to the PHP module:
break
was a keyword in the PHP language before version 8.0, soOpenCReport\Break
had to be renamed toOpenCReport\ReportBreak
to work under PHP 7.4 and older.- PHP 7.3 introduced some changes to the internal hash handling which allowed implementing a new PHP array datasource driver in 0.8.6. That obviously doesn't work under under PHP 7.2 or older. The old PHP array datasource code was re-implemented under the new datasource API regime conditionally. The old method can be used with
./configure --with-opencreports-static-array
with PHP 7.3 and newer and it's automatically used with older versions.
Miscellaneous changes:
- As compilation and testing was performed under older Linux versions, some superficial changes were necessary to support them.
- PostgreSQL support is built conditionally now, based on the presence of
PQdescribePortal()
. This client API function was introduced in PostgreSQL 8.2.0 in 2006. - Some unit tests gained new output variants that are considered successful. The difference is in locale behaviour, which can be different across GLIBC and PHP versions and can also depend on the installed set of language support.
[1] An attempt was also made to build OpenCReports under CentOS 5 to test PHP 5.3 but this would need substantial package upgrades and may break the system.
0.8.7: Compatibility fixes
- User visible change: allow
<HorizontalLine>
to be right and center aligned. - User visible change: clarify behaviour of
<Report height="...">
in the XML description in RLIB compatibility mode. - Relaxed library dependency requirements for Cairo, Pango, librsvg, utf8proc, libmysqlclient, PostgreSQL, unixODBC, MPFR and GLIBC. [1]
- Fix build errors observed with GCC 14 and CLANG 18
- Fix build errors with CLANG for unit tests relying internal arrays (
-rdynamic
vs-Wl,--export-dynamic
) - Allow unit test result variants that can be equally correct. Especially formatting can depend on the C runtime version.
- Internal code cleanup
- Documentation updates
[1] Tested build and unit test results under Amazon Linux 2 which was recently EOL'd. The build succeeds on this old Linux distro, but the stock Cairo version in Amazon Linux 2 (1.15.12) crashes during unit test runs, and for some reason even 1.16.0, which didn't on my Fedora development system. Cairo version 1.17.6 is needed on this system to avoid the crashes. Also, there are rendering deviations between my development system and Amazon Linux 2, due to Pango and font version differences. YMMV.
0.8.6: External datasources and other changes
- Replaced datasource type specific APIs (array, CSV, JSON. XML, MariaDB, PostgreSQL, ODBC) with category specific API (data, file, SQL) . This is still not a stable release, so API changes are excusable for a minor release
- Made external datasources not just possible, but easy
- Added a new PHP specific array datasource driver that doesn't convert the PHP array to C array, eliminating the necessity to track and free converted arrays at the end of the request
- Eliminated visual gaps in the HTML output that's not there in PDF (tested with Chrome and Firefox)
- Separated
r.lineno
from therownum()
function - functions may be overridden by the user, the internal variable must always work - Another API change that requires
ocrpt_report_set_main_query()
to be called for hand-rolled report usage - Made
r.value
work better in unit tests or in hand-rolled report usage withoutocrpt_execute()
- Made
r.self
work better in bothv
domain variables and in expressions using it directly. Particularly,isnull(r.self)
works for the first row of the dataset - Improved RLIB compatibility:
<Report height="n">
is interpreted correctly - Improved RLIB compatibility: the
xml_rlib_compat
output parameter is automatically enabled byrlib_init()
in PHP - Extended the PHP API to cover more C API
- Allowed
#include <opencreport.h>
to work in C++ code - Updated unit tests
- Massive documentation updates, split concepts into their own sections before technical reference sections
- Added missing
NULL
pointer checks and other misc. fixes thanks toAddressSanitizer
0.8.5: Barcode support and misc fixes
- Support
<Barcode>
as both part of<Line>
and<Output>
- Supported barcode encodings: EAN-8, UPC-8, UPC-12, EAN-13, ISBN, Code39 (basic and extended), Code128 (B/C/full)
- Extended C and PHP API to support barcode from program code
- Extended documentation
- Fixed indentation of subsequent
<Line>
content when the lines grow over the previous<Image>
and<Barcode>
height - Small fixes thanks to
AddressSanitizer
0.8.3: Fixes and documentation updates
- Extended the documentation with complete examples
- Misc documentation fixes
- Use a better workaround for the PHP module crash at shutdown (PHP scripts are fast again)
- Fix rendering the last text element of a line if no width property is set with or without a logo image
- Fix visual gaps better between rectangles (i.e. background of text elements)
- Fix corner cases in resetting or precalculating variables
- Fix rendering image line elements that are found from the internal cache
- Misc fixes
0.8.2: Fix a use-after-free bug in 0.8.1
Fix use-after-free in the parser introduced by the vector comparison handling in 0.8.1
0.8.1: Improved RLIB compatibility and other changes
RLIB compatibility changes:
- Added previously missing
eval()
andstrlen()
functions - this completes the set of functions that existed in RLIB - Fixed
r.format
handling - Correctly render
NULL
values: either use an empty string or format the value using theformat="..."
expression if it exists - Reimplemented N:1 follower traversal. A report with multiple linked N:1 followers correctly generates the same data as an SQL query using multiple LEFT OUTER JOINs.
- Implemented a single row matching flag for N:1 followers to mimic RLIB's (buggy) follower implementation. This is used automatically when compatibility report XML descriptors are used
- Implemented vector comparison operators. This was a planned (actually, implemented in 2016 then reverted) feature of RLIB.
Other changes:
- Reviewed arginfo for PHP methods and fixed them where needed
- PDF output format is the default,
OCRPT_OUTPUT_UNSET
is gone - Fixed a unit test translation file compiler error under Fedora 39
- Added a workaround for crashing the PHP interpreter when scripts finish too quickly
- Use an external VERSION file to indicate the version
- Small memory leak and use-after-free fixes
0.8.0: Extra output drivers
Added output drivers for HTML, TXT, CSV, XML, JSON
Another API overhaul for less typing
Documentation updates.
Misc fixes
0.7.0: Add PHP binding
Added the PHP module with comparable functionality to the C API, complete with documentation and a comprehensive set of unit tests which is an extended subset of C unit tests ported to PHP.
The PHP module includes an RLIB compatibility API.
C API changes:
- Added
ocrpt_version()
- Array and file based input driver extensions to facilitate using them in the PHP binding
- Added new API functions so event callbacks may be added in the global context (i.e. using
opencreport *
pointer) instead of child element (e.g. part, report) context. Such event callbacks apply to every element of the same type. E.g. a "report start" event callback will be called for every report in a multi-report report. This is needed to implement better RLIB compatibility PHP API. The previously existing callback API functions work on individual elements.
<field>
and <literal>
nodes in the XML DTD are equivalent. The API also reflects this.
Code portability updates, memory leak fixes.
Output generation changes:
- All expressions may reference query columns. The use case is that supplementary queries with single row data sets may be used to set global options that may not refer to report variables or queries used by reports. For example, a
<Part>
node is in a higher scope outside<Report>
. As such, the part configuration options may not refer report related identifiers. E.g.<Part suppress="config.suppress">
would be set from a column calledsuppress
of a query calledconfig
, using the query's first data row. - The above also applies to
<load ...>
nodes to load<Report>
nodes from files. - Page headers are rendered at the start of rendering a page. This allows using the query data row valid for the beginning of the page. Previously, page headers and page footers were rendered at the end of rendering a page.
Report related changes:
- Added a new function called
prevval()
which takes an expression. It returns the value of the expression from the previous data row. It may be used to implement "data transferred from the previous page" in the header of the current page. - For single
<Report>
reports, the page header and footer may be associated with the the implicitly created<Part>
. It is done automatically if the report layout is parsed from an XML description. - Implemented
headernewpage
andsuppressblank
for<Break>
s.
Invalid identifier names in expressions are converted to strings automatically now. This will show up in report outputs allowing fixing typos more easily.
Rewritten documentation generation to use xsltproc
and fop
Miscellaneous fixes.
0.6.3: Extend translation with singular/plural choice
Added a new translate2()
function that uses dngettext()
behind the scenes, to allow language translations with different singular and plural forms.
Fixed the XML for the unit test layout_pdf_translate_xml1_test
. Field expressions using translate()
do not need the explicit translate="yes"
attribute.