Chart with option or separate reports

Geert Janssens geert.gnucash at
Fri Dec 2 07:27:49 EST 2016

Op vrijdag 2 december 2016 10:21:54 CET schreef Robert Fewell:
> Hi,
> Just looking at making the chart reports more consistent 

> and noticed that
> some have an option to select line or bar chart while 'Net Worth' and
> 'Income & Expenses' have separate reports.
> Should these be changed to an option ?

Yes, that would be a good thing. This work was started by Carsten Rinke some 
time ago. Apparently these two were forgotten.

> If so, am I correct that each new combined report would require a new guid,
> the old reports deleted and as the report version has been updated will not
> cause concern.

That's only half of the story...
Imagine you are a user happily using gnucash 2.6 and you have several saved 
report configurations based on one of the above mentioned reports. In addition 
at least one report is still open in a tab.

Now you migrate to 2.8. What do you want to see happen as that user ? Well 
nothing. Everything should just continue to work as before. That is of course 
the ideal situation and not always achievable. But let's see how close we can 

You didn't specify what you intended to do with the old reports. I assume 
you'd want to remove them as they have been superseded by your new reports.

That would mean the user loses both his saved reports and the open report 

So, to deal with this I  would
1. choose the post popular variant (which is either line or bar - a poll or 
query on gnucash-user/gnucash-devel should give an idea) and amend that report 
to also handle the other variant. So it would get the additional option, 
defaulting to whichever was there originally. Don't change the report guid.
=> This would ensure that at least for the most popular variant the saved and 
open reports just continue to work.

2. For the other variant, remove it from the reports menu, but internally keep 
the report definition. Instead of a fully fledged report the code for this 
other variant should just load the first variant with the additional, new 
report option set. There are other examples of this in the reports code.
=> This would ensure the other saved and open reports continue to load. If 
done properly they will be converted transparently in the new report format.

Finally, the version bump on saved-reports will prevent the new option from 
ever appearing in the older saved-reports file for 2.6 and earlier.

The only thing we can't reasonably avoid is going back to gnucash 2.6 with a 
new style report still open when leaving gnucash 2.8. In this case the most 
popular variant from point 1 will appear in all situations, because the new 
option isn't known in 2.6. Theoretically we could handle this as well by 
defining the option in the non-gui parts of 2.6 already and redirect the 
report if the option turns out to be set. IMO that would lead too far though.



More information about the gnucash-devel mailing list