9.5. Creating or Modifying Reports and Charts

It is possible to modify existing or write own reports, if the available ones are not suitable. To do this you will need to know Guile, GNOME's implementation of Scheme, which again is a LISP-like programming language, and it is an excellent idea to have a copy of the GnuCash source code available.

Introductory files in the source code

9.5.1. Accessing the GnuCash Application Programming Interface (API)

To get informations from your GnuCash book for your report it is also necessary to access data from the GnuCash engine. This binding is generated by Swig and based on a set of Scheme wrapper functions in bindings/guile. [6]


Examine some of the other reports in gnucash/report/ for an indication of how they are used.

Some users started a table in https://wiki.gnucash.org/wiki/Custom_Reports#The_GnuCash_API.

Because the above file only contains the syntax of the function you can use the nightly Doxygen generated API documentation online for the bugfix branch or feature branch to get more information about the functions.

After setting up a build environment you can also generate it locally by running

# make users:
make doc
# ninja users:
ninja doc

in your build directory and then open BUILDDIR/libgnucash/doc/html/index.html with your preferred browser.

9.5.2. Report Rendering

At present, reports are produced by calling a HTML-generation API, which outputs a dialect of HTML and rendering this with a HTML widget. This has limitations, particularly when trying to align objects precisely, as might be necessary for printing onto pre-printed invoices for example.

See also Section 9.4, “Printing or Exporting Reports and Charts”.

[6] Up to version 2.0.5 G-Wrap was used and the file was src/g-wrap/gnc.html.