GSOC ReportBuilder Weekly Update

Adam Seskunas adamseskunas at gmail.com
Tue Jul 1 21:32:20 UTC 2025


In my last email I talked about the potential issues implementing Formulas
in ReportBuilder without using the Pentaho library. I'm happy to report
that during the last week I think I've found a solution that I've
implemented in the following patch. It allows you to add a Formula, with
the caveat that it has no parameters.

https://gerrit.libreoffice.org/c/core/+/185810

The patch uses XFuntionAccess callFunction, which I found doing some
searching during the week. The following documentation from the SDK
Development Guide has more information about using XFunctionAccess

https://wiki.documentfoundation.org/Documentation/SDKGuide/Functions_and_Data_Analysis

The API Reference for XFunctionAccess can be found here

https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1sheet_1_1XFunctionAccess.html

A couple of notes about this:

1. A quick look through the list of available functions and it seems that
they match up with what is  currently available in ReportBuilder. If there
are specific functions missing, they could      potentially be implemented
in C++ since they would be few in number.

2. Using XFunctionAccess abstracts away the function input and output types
to uno::Any. It is to be determined whether this will make things easier or
harder. My current plan is to get the Formula code as operational as
possible, then move on to the next step of implementing the Grouping code,
and then come back to this issue.

3. A Formula may contain other Formulas, database input or be entirely user
defined. This means that a Formula must be parsed and potentially compiled.
There is a library for this located here
https://opengrok.libreoffice.org/xref/core/include/formula/
There is also some Java wrapper code that uses some Pentaho libraries that
seems to have roughly the same function, located here
https://opengrok.libreoffice.org/xref/core/reportbuilder/java/org/libreoffice/report/pentaho/SOFormulaParser.java?r=bb437029c1e5331bcc3f8fb2fc87837142a52f33

Which leads to my current progress, trying to get Formulas parsed in some
meaningful way using the libraries in include/formula. Currently I'm
working on getting a working Reference to an XFormulaParser UNO object in
reportdesign/source/filter/xmlExport.cxx.

If anyone knows of any documentation or good examples of using the parser
or compiler located in include/formula I would be very appreciative of any
information.

That's it for now, thanks for reading and have a good week.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice/attachments/20250701/6e61c54d/attachment.htm>


More information about the LibreOffice mailing list