[GNC-dev] How to get Report Development Environment Working in Windows

flywire flywire0 at gmail.com
Fri Sep 3 06:18:29 EDT 2021

On Fri, Sep 3, 2021 at 10:48 AM John Ralls <jralls at ceridwen.us> wrote:

> It looks like much of that page dates from GnuCash 2.6 that used an
> earlier version of Guile than we use now... Note that none of this is
> needed for GnuCash to execute your config-user.scm as it sets up the paths
> for itself.


Fixed (all but reportname) by updating the outdated code in:

Unfortunately, I want the split reports but that code won't run as
described in: https://wiki.gnucash.org/wiki/Custom_Reports#Minimal_Example
(the second Prototype report doesn't appear in Reports Examples.) It could
be another syntax issue. Maybe someone could test it?


;; (define-module (gnucash report example prototype))
(define-module (gnucash report example prototype_loader))
;;(define-module (prototype_loader))

;;(use-modules (gnucash engine))
;;(use-modules (gnucash utilities))
(use-modules (gnucash core-utils)) ; for gnc:version and (G_ ...)
(use-modules (gnucash app-utils))
(use-modules (gnucash report))
;;(use-modules (gnucash html))

(debug-enable 'backtrace)

;; load the renderer module once at the top level to get the symbols
(use-modules (document-renderer))

;; get and reload the module
(define (reload-report-module)
  (reload-module (resolve-module '(document-renderer))))

;; every time options generated, reload from document-renderer
(define (options_loader)

;; every time report rendered, reload from document-renderer
(define (renderer_loader report-obj)
  (document-renderer report-obj))

 'version 1
 'name (N_ "Prototype")
 'report-guid "cac2d303ec53449eb163e50117356b91"
 'menu-tip (N_"<type your report menu tip here>")
 'menu-path (list gnc:menuname-example)
 'options-generator options-generator
 'renderer document-renderer)

* document-renderer.scm *

(define-module (document-renderer))

;; options for the report (called by loader after it reloads this module)
(define (options-generator)
  (let* ((options (gnc:new-options)))
    ; add your options here

;; report renderer (called by loader after it reloads this module)
(define (document-renderer report-obj)
  (let ((doc (gnc:make-html-document)))
    ;; add your renderer here
       (format #f (G_ "~a")

(export options-generator)
(export document-renderer)

* config-user.scm *

(load (gnc-build-userdata-path "my-world.scm"))
(load (gnc-build-userdata-path "prototype.scm"))
(load (gnc-build-userdata-path "prototype-loader.scm"))

More information about the gnucash-devel mailing list