Custom Report loading

Lincoln A. Baxter lab at lincolnbaxter.com
Fri Jan 22 07:14:09 EST 2010


On Thu, 2010-01-21 at 21:00 -0800, Jason Dunham wrote:
> I'm trying to write a custom report for Gnucash.  I'm using version 2.3.8
> for Windows.
> 
> Following the directive in http://wiki.gnucash.org/wiki/Custom_Reports, I
> created a new file C:\Users\jdunham\.gnucash\config.user, and it contains
> the contents
> 
> (load-from-path "D:\jason\gnucash\custom\JasonsReport.scm")
> 
> 
> The report does not load, even though I am sure that path is valid, and the
> following is in the trace file.
> 
> <unnamed port>: In procedure primitive-load-path in expression
> (primitive-load-path name):
> <unnamed port>: Unable to find file "D:jasongnucashcustomJasonsReport.scm"
> in load path
> In unknown file:
>    ?: 0* [primitive-load-path "D:jasongnucashcustomJasonsReport.scm"]
> *   WARN <gnc.app-utils> Could not spawn perl: Failed to execute child
> process (No such file or directory)
> 
> 
> Note the lack of any backslashes in the trace file's version of my path.  I
> moved the file to C:\Users\jdunham\.gnucash (the same folder containing this
> config.user file), and changed the directive to (load-from-path
> "JasonsReport.scm"), but I get very similar results:
> 
> <unnamed port>: Unable to find file "JasonsReport.scm" in load path
> 
> 
> Any advice?
I think GC is using Unix file system semantics, it is running with Unix
system emulation libraries.

The D: or C: is being interpreted as Hostname: (remote system)
The backslashes are being interpreted as escapes literalizing the
following characters.

Try one of these three:

//d/jason/gnucash/custom/JasonsReport.scm
//c/users/jdunham/.gnucash/JasonsReport.scm
/users/jdunham/.gnucash/JasonsReport.scm

More portable would be make it a relative path, as
in ./.gnucash/JasonsReport.scm.  You'll need to know where GC thinks it
is when it starts. (There is probably a .bat file that starts it, if
there is not, you can create one).  I don't know if the HOME environment
variable is defined, but you could define it in a startup script (.bat
file).  A quick look at the sources for druid-gconf-setup.c and
gnc-path.c tells me that GC probably looks in the HOME directory for
files.   This would make a relative path effectively
$HOME/.gnucash/JasonsReport.scm, someone who supports the Windows port
and reporting will have to confirm this.  

All of this behavior should be documented in the documentation for the
Windows port.  I did a quick search and did not find anything, it if it
exists a quick search did not find it. If it does not exist, I suggest a
bug be entered against the windows port to clarify this.

Lincoln




More information about the gnucash-user mailing list