Custom Report loading
Jason Dunham
jwdunham at gmail.com
Fri Jan 22 19:05:34 EST 2010
On Fri, Jan 22, 2010 at 8:06 AM, Derek Atkins <warlord at mit.edu> wrote:
> "Maf. King" <maf at chilwell.net> writes:
>
> > On Friday 22 January 2010 12:14:09 Lincoln A. Baxter wrote:
> >> 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.
> >
> > <SNIP>
> >
> >> > <unnamed port>: Unable to find file "JasonsReport.scm" in load path
> >> >
>
> >> Try one of these three:
> >>
> >> //d/jason/gnucash/custom/JasonsReport.scm
>
didn't work
> >> //c/users/jdunham/.gnucash/JasonsReport.scm
>
didn't work
>> /users/jdunham/.gnucash/JasonsReport.scm
>
did work, though inability to specify the volume seems like a bug.
> >
> > Just a thought : you could also try escaping the backslash, which I think
> > might be something like d\:\\jason\\gnucash\\..etc..etc. but I'm just
> > guessing about that on windows.
>
> I don't think you need to escape the colon, but yes, you need to use
> double-backslashes.
>
>
Did work:
(load-from-path "D:\\jason\\gnucash\\custom\\JasonsReport.scm")
OK, so now GC can load the report, which is clone of hello-world.scm with
new names. However GC 2.3.8 crashes silently on load. there is nothing in
the trace file, except a couple of unrelated lines which were there with no
report loaded at all. I also tried an unmodified copy of hello-world.scm
and it crashes the same way.
I tried hello-world.scm from GC 2.2.9 and it gets farther, with the
following trace:
* WARN <qof.engine> [guid_init()] only got 2229 bytes.
The identifiers might not be very random.
* WARN <gnc.app-utils> <unnamed port>: In procedure scm-error in
expression (scm-error (quote misc-error) #f ...):
<unnamed port>: not-a-record #f
In unknown file:
?: 0* [primitive-load-path
"D:\\jason\\gnucash\\custom\\hello-world.scm"]
In D:\jason\gnucash\custom\hello-world.scm:
460: 1* [gnc:define-report version 1 ...]
In unknown file:
?: 2 (letrec ((args-to-defn #) (blank-report #)) (let (#) (if # # #)))
In C:\Program Files (x86)\gnucash\share\gnucash\scm/report.scm:
...
116: 3 (begin (if # #) (if # #) ...)
117: 4* (if (gnc:report-template-name report-rec) (begin # # # ...))
118: 5 (begin # # # ...)
137: 6* [gnc:report-template-save-to-savefile #]
595: 7 (let (# #) (display saved-form #) (force-output))
596: 8* [gnc:report-template-generate-saved-forms #]
558: 9 (let* (# # # ...) (gnc:report-generate-saved-forms-string name
type ...))
560: 10* [gnc:report-template-name #f]
In unknown file:
?: 11 (and (eq? (quote #) (record-type-descriptor obj)) (struct-ref obj
1))
?: 12* [eq? #<record-type <report-template>> ...
?: 13* [record-type-descriptor #f]
?: 14 (if (struct? obj) (struct-vtable obj) (error (quote not-a-record)
obj))
...
?: 15 [scm-error misc-error #f "~A ~S" (not-a-record #f) #f]
I guess I need to open a bug on this, but if anyone has any tips, that would
be great.
Jason
More information about the gnucash-user
mailing list