After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 385245 - Expense Piechart does not allow changing # of slices
Expense Piechart does not allow changing # of slices
Status: VERIFIED DUPLICATE of bug 347462
Product: GnuCash
Classification: Other
Component: Reports
2.0.x
Other All
: Normal normal
: ---
Assigned To: Chris Lyttle
Chris Lyttle
Depends on:
Blocks:
 
 
Reported: 2006-12-12 23:00 UTC by bugbuddy
Modified: 2018-06-29 21:18 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description bugbuddy 2006-12-12 23:00:33 UTC
Please describe the problem:
When you open up the options in the Expense Piechart & change the # of slices shown in the report, the report will no longer run (even if you change back to the original # of slices.)

Steps to reproduce:
1. Select Expense Piechart from Reports menu
2. Click Options button
3. On 'Display' tab, change maximum slices value
4. Click Apply


Actual results:
Report says:

Report Error:
An error occured while running the report

Expected results:


Does this happen every time?
yes

Other information:
output to console:  (I selected 6 slices in this case)

 In unknown file:
   ?: 18* [#<procedure #f ()>]
In /usr/share/gnucash/guile-modules/gnucash/main.scm:
 162: 19* [lazy-catch #t #<procedure #f ()> #<procedure dumper (key . args)>]
In unknown file:
   ?: 20* [#<procedure #f ()>]
In /usr/share/gnucash/guile-modules/gnucash/main.scm:
 163: 21* [apply #<procedure #f ()> ()]
In unknown file:
   ?: 22  [#<procedure #f ()>]
In /usr/share/gnucash/scm/report.scm:
    ...
 444: 23  (set! html (gnc:report-render-html report #t))
 444: 24* [gnc:report-render-html # #t]
 409: 25  (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext report) ...)
 417: 26  (let ((template #) (doc #f)) (set! doc (if template # #f)) doc)
 420: 27* (set! doc (if template (let* # # # ...) #f))
 420: 28* (if template (let* # # # ...) #f)
 421: 29  (let* (# # # ...) (gnc:html-document-set-style-sheet! doc stylesheet) ...)
 423: 30* [#<procedure #f #> #]
In /usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:
 475: 31  [piechart-renderer # "Expense Accounts" # ...]
In unknown file:
    ...
   ?: 32  (letrec (# # # #) (if # # #) (gnc:report-finished) ...)
In /usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:
 304: 33* (if (not #) (begin # # # ...) (gnc:html-document-add-object! document #))
 305: 34  (begin (set! work-to-do #) (set! combined #) (if # #) ...)
 330: 35* (if (> (length combined) max-slices) (let* (# # #) (set! combined #) ...))
 331: 36  (let* ((start #) (finish #) (sum #)) (set! combined (append start #)) ...)
 331: 37* [list-head ((4166.44 #) (2838.0 #) (2653.01 #) (2504.0 #) ...) 5.0]
/usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:331:31: In procedure list-head in expression (take combined (- max-slices 1)):
/usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:331:31: Wrong type (expecting exact integer): 5.0
In unknown file:
   ?: 15* [#<procedure #f ()>]
In /usr/share/gnucash/guile-modules/gnucash/main.scm:
 162: 16* [lazy-catch #t #<procedure #f ()> #<procedure dumper (key . args)>]
In unknown file:
   ?: 17* [#<procedure #f ()>]
In /usr/share/gnucash/guile-modules/gnucash/main.scm:
 163: 18* [apply #<procedure #f ()> ()]
In unknown file:
   ?: 19  [#<procedure #f ()>]
In /usr/share/gnucash/scm/report.scm:
    ...
 444: 20  (set! html (gnc:report-render-html report #t))
 444: 21* [gnc:report-render-html # #t]
 409: 22  (if (and (not #) (gnc:report-ctext report)) (gnc:report-ctext report) ...)
 417: 23  (let ((template #) (doc #f)) (set! doc (if template # #f)) doc)
 420: 24* (set! doc (if template (let* # # # ...) #f))
 420: 25* (if template (let* # # # ...) #f)
 421: 26  (let* (# # # ...) (gnc:html-document-set-style-sheet! doc stylesheet) ...)
 423: 27* [#<procedure #f #> #]
In /usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:
 475: 28  [piechart-renderer # "Expense Accounts" # ...]
In unknown file:
    ...
   ?: 29  (letrec (# # # #) (if # # #) (gnc:report-finished) ...)
In /usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:
 304: 30* (if (not #) (begin # # # ...) (gnc:html-document-add-object! document #))
 305: 31  (begin (set! work-to-do #) (set! combined #) (if # #) ...)
 330: 32* (if (> (length combined) max-slices) (let* (# # #) (set! combined #) ...))
 331: 33  (let* ((start #) (finish #) (sum #)) (set! combined (append start #)) ...)
 331: 34* [list-head ((4166.44 #) (2838.0 #) (2653.01 #) (2504.0 #) ...) 5.0]
/usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:331:31: In procedure list-head in expression (take combined (- max-slices 1)):
/usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm:331:31: Wrong type (expecting exact integer): 5.0
Comment 1 bugbuddy 2006-12-12 23:29:24 UTC
I was able to fix this myself, though it is probably not the most elegant solution due to the fact that I'm not too familiar with Scheme.  It looks like the value grabbed off of the option form is a floating point instead of an integer value which is causing the problem when it attempts to use it to loop.

In /usr/share/gnucash/guile-modules/gnucash/report/account-piecharts.scm (line 191), it looks like the value from the options window is being assigned to max-slices variable:

        (max-slices (get-option gnc:pagename-display optname-slices))

I forced it into a rounded-down integer by changing line 191 to this:
        (max-slices (quotient (inexact->exact (get-option gnc:pagename-display optname-slices)) 1))

This fixes the problem with the report.
Comment 2 Andreas Köhler 2006-12-13 08:05:29 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 347462 ***
Comment 3 John Ralls 2018-06-29 21:18:37 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=385245. Please update any external references or bookmarks.