report html generation question

Arthur Ralfs arthur at mathbrane.ca
Fri Jan 9 18:21:11 EST 2009


Hello gnucash developers,

I've recently joined this list because I was looking at the report
system.

Examining a simple hello world report I see an elaborate scheme
structure to generate html.  However when I export the report as
html I don't see any evidence of this scheme generated html.

To be definite here's the hello world report stripped down to the (nearly)
bare minimum:

begin file-----------------------------

(define-module (gnucash report test-min))
(use-modules (gnucash gnc-module))
(gnc:module-load "gnucash/report/report-system" 0)
(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url

(define (options-generator)   
  (let* ((options (gnc:new-options)))
    options)
  )

(define (testmin-renderer report-obj)
  (let ((document (gnc:make-html-document)))
    (gnc:html-document-add-object!
     document
     (gnc:make-html-text (gnc:html-markup "p" (_ "Hello World") ) )
     )
    document
    )
  )

(gnc:define-report
 'version 1
 'name (N_ "Test Min")
 'menu-name (N_ "Test Min Report")
 'menu-tip (N_ "A minimum hello world report.")
 'menu-path (list gnc:menuname-utility)
 'options-generator options-generator
 'renderer testmin-renderer)

end file------------------------------------------

When I export the report this is the html I get:

begin file-----------------------------------------

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.18.1">
</HEAD>
<BODY BGCOLOR="#ffffff">
Hello World<BR>
<BR>
</BODY>
</HTML>

end file---------------------------------------------

This html appears not to be the html I expected to get looking at the
scheme code.

Why is this?  I would much rather get the scheme generated html than this.

Arthur Ralfs


More information about the gnucash-devel mailing list