gnucash report writing resources for beginners?
Derek Atkins
warlord at MIT.EDU
Wed Jan 7 09:43:14 CST 2004
John Steele Scott <toojays at toojays.net> writes:
> On Tue, 6 Jan 2004 02:03, Derek Atkins wrote:
>> > 1) Is there any kind of interactive interpreter built into gnucash which
>> > one could use to execute Scheme code on the fly?
>>
>> "gnucash-env guile"
>
> This might be able to help me. So far, I've found that I can put in the
> following to generate a "Hello, World" report:
>
> (use-modules (gnucash gnc-module))
> (gnc:module-load "gnucash/engine" 0)
> (use-modules (gnucash report report-system))
> (use-modules (gnucash report report-gnome))
> (use-modules (gnucash app-utils))
> (use-modules (gnucash report hello-world))
> (gnc:report-run (gnc:make-report "Hello, World"))
This is wrong -- you should never use (use-modules ...) when there
is an equivalent (gnc:module-load ...) for the same module. So,
this should probably be:
...
(gnc:module-load "gnucash/report/report-system" 0)
(gnc:module-load "gnucash/report/report-gnome" 0)
(gnc:module-load "gnucash/app-utils" 0)
...
> However, this would be more useful if I could pop up the options dialog. It
> looks to me like I should be able to do it with:
>
> (gnc:report-edit-options (gnc:find-report 0))
>
> But that always segfaults. Do I need to first call something to initialise the
> GUI in some way?
Maybe -- However you also need to load the modules properly.
> By the way, after messing with this stuff, it looks like my config file must
> have been destroyed somehow, because I had to set the default currency back
> to AUD (from USD) when I next tried to run gnucash normally.
That's certainly possible...
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord at MIT.EDU PGP key available
More information about the gnucash-user
mailing list