Opening saved account reports
Chris Shoemaker
c.shoemaker at cox.net
Thu Oct 19 17:36:32 EDT 2006
On Thu, Oct 19, 2006 at 03:42:42PM -0400, Mike Alexander wrote:
> I'm in the process of getting things to work again after updating to
> the swig version of gnucash. It mostly seems to work, but I've noticed
> a few things.
>
> For example, when I opened a file that had an Account Report (or
> Account Transaction Report) window open when it was saved in the g-wrap
> version of gnucash I got the error:
>
> register.scm:564:17: In procedure gnc_query_scm2compare in expression
> (gnc-scm2query query-scm):
> register.scm:564:17: Wrong type argument in position 1:
> query-compare-equal
Just to clarify, you got this in the console, but gnucash didn't
crash, right? You probably got a "this report had errors" page,
right?
> The code in register.scm gets the query from a parameter passed in to
> it by the C code. In this case the query it gets is
>
> (query-v2 (terms (((("book" "guid") #f guid query-compare-equal
> guid-match-any ("6320ae727a3710d93d3ca7b097c43157")) (("account"
> "guid") #f guid query-compare-equal guid-match-any
> ("ab40d43d2091ea21672ec1ba2113b630"))))) (search-for Split)
> (primary-sort (("QofQueryDefaultSort") 0 #t)) (secondary-sort #f)
> (tertiary-sort #f) (max-results -1))
>
> If I run the report again after opening the file it gets a different
> query:
>
> (query-v2 (terms (((("book" "guid") #f guid 3 1
> ("6320ae727a3710d93d3ca7b097c43157")) (("guid") #f guid 3 1
> ("4055379c49a2142af5dc7ef59bd1ce49"))))) (search-for Split)
> (primary-sort (("QofQueryDefaultSort") 0 #t)) (secondary-sort #f)
> (tertiary-sort #f) (max-results -1))
>
> It looks like the symbols query-compare-equal and guid-match-any have
> been turned into numeric parameters in the new query. (The GUIDs
> changed since I probably selected a different account.) I don't know
> whether the bug is in the processing of the query or the generation of
> the query.
Yeah, the swig wrappers wrap enums as numbers, while the g-wrap
wrappers wrapped them as symbols. For that reason, and probably many
more, in theory, saved reports from 2.0 (g-wrap) may be unreadable in
2.2. In practice, I think most reports will work fine, but saved
queries won't.
-chris
>
> This isn't a big deal since it only seem to affect documents with saved
> reports, but it might be a symptom of a wider problem (or it might be
> something I'm doing wrong).
>
> --
> Mike Alexander mta at umich.edu
> Ann Arbor, MI PGP key ID: BEA343A6
>
>
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel
More information about the gnucash-devel
mailing list