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 721654 - Style sheet preference is not saved for a Preconfigured Report
Style sheet preference is not saved for a Preconfigured Report
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
2.6.0
Other Linux
: Normal normal
: ---
Assigned To: gnucash-reports-maint
gnucash-reports-maint
Depends on:
Blocks:
 
 
Reported: 2014-01-06 20:48 UTC by Richard Ullger
Modified: 2018-06-29 23:24 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Richard Ullger 2014-01-06 20:48:02 UTC
The style sheet selected in Report Options -> General Tab -> Stylesheet: is not saved when you save a report. The next time the saved report is run, gnucash uses the Default style sheet.

This is regardless of whether the style sheet selected is a gnucash style sheet (Default, Easy, Footer, Technicolor) or a user defined style sheet.
Comment 1 Geert Janssens 2014-02-14 18:10:17 UTC
Thank you for your report. I am having trouble reproducing this with GnuCash 2.6.1 however. I have
- opened a Vendor Report
- changed the stylesheet to technicolor
- saved these settings as a Preconfigured report
- closed the open report
- restarted gnucash
- loaded the preconfigured report
=> The stylesheet is still technicolor

Can you check if you still can reproduce this in gnucash 2.6 ?

If so, please report the steps you took to reproduce the problem.
Comment 2 Richard Ullger 2014-02-15 17:52:05 UTC
I tried this with the Technicolor and Easy stylesheets and this is working in 2.6.1.

To reproduce the error in 2.6.1...

- Create a new stylesheet. (Edit -> Style Sheets, then click the New button).
- Reports -> Assets & Liabilities -> Advanced portfolio.
- When the report has run, click the edit report options button.
- Change the stylesheet from Default to the stylesheet you created.
- Change the report name.
- Click OK. The report is regenerated using the new stylesheet.
- Click the button, Add the current report's configuration to the 'Preconfigured Reports' menu.
- In the Preconfigured Reports window that is displayed, press return to accept the report name. Click Close.
- Close the report tab.
- Close gnucash.
- Start gnucash. The previously opened file is loaded.
- Reports -> Preconfigured Reports.
- Double click the saved report you created.
- The report is generated using the Default stylesheet.
- Click the edit report options button to confirm that the stylesheet is set to Default.
Comment 3 lemur2009 2014-03-08 13:19:02 UTC
The same for 2.6.2.
GnuCash doesn't save stylesheets created by user. They simply disappear after you restart the program.

Windows 7 32-bit
Comment 4 Geert Janssens 2014-03-08 17:11:26 UTC
(In reply to comment #2)
> I tried this with the Technicolor and Easy stylesheets and this is working in
> 2.6.1.
> 
> To reproduce the error in 2.6.1...
> 
> - Create a new stylesheet. (Edit -> Style Sheets, then click the New button).
> - Reports -> Assets & Liabilities -> Advanced portfolio.
> - When the report has run, click the edit report options button.
> - Change the stylesheet from Default to the stylesheet you created.
> - Change the report name.
> - Click OK. The report is regenerated using the new stylesheet.
> - Click the button, Add the current report's configuration to the
> 'Preconfigured Reports' menu.
> - In the Preconfigured Reports window that is displayed, press return to accept
> the report name. Click Close.
> - Close the report tab.
> - Close gnucash.
> - Start gnucash. The previously opened file is loaded.
> - Reports -> Preconfigured Reports.
> - Double click the saved report you created.
> - The report is generated using the Default stylesheet.
> - Click the edit report options button to confirm that the stylesheet is set to
> Default.
Nope, I  can't reproduce this here on Fedora 20 with my 2.6.2 build. So I'll have to go by details from your system.

1. Which OS are you using ?
2. Can you open <your-home-dir>/.gnucash/saved-reports and locate the definition of your preconfigured report. It should start with something similar to this:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Options for saved report "Advanced Portfolio Style Test", based on template "21d7cfc59fc74f22887596ebde7e462d"
(let ()
 (define (options-gen)
  (let ((options (gnc:report-template-new-options/report-guid "21d7cfc59fc74f22887596ebde7e462d" "Advanced Portfolio")))

; Section: General

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Stylesheet")))
  ((lambda (option) (if option ((gnc:option-setter option) '#{Test Sheet}#))) option))

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Report name")))
  ((lambda (option) (if option ((gnc:option-setter option) "Advanced Portfolio Style Test"))) option))

In particular in the part about "Stylesheet" what is set in ((gnc:option-setter option) xxxxx)))
The bit where it says '#{Test Sheet}# in my example. What's there in your case ?
Comment 5 Geert Janssens 2014-03-08 17:14:32 UTC
One more question as a result of comment 3:

Does your custom stylesheet still exist in Edit->Style Sheets ?
Comment 6 Richard Ullger 2014-03-08 21:27:39 UTC
(In reply to comment #4)

> 1. Which OS are you using ?

I'm using Arch Linux. I've recompiled gnucash using the default PKGBUILD but with the --enable-ofx --enable-aqbanking configure options removed and the --disable-dbi --enable-python options added. And now with the version updated to 2.6.2. The Arch repos don't have 2.6.2 yet.

> 2. Can you open <your-home-dir>/.gnucash/saved-reports and locate the
> definition of your preconfigured report.

The file in my .gnucash directory is saved-reports-2.4. I have just saved this new custom report and the report definition is shown below. As you can see it does not contain a stylesheet setting.

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Options for saved report "Advanced Portfolio Test", based on template "21d7cfc59fc74f22887596ebde7e462d"
(let ()
 (define (options-gen)
  (let ((options (gnc:report-template-new-options/report-guid "21d7cfc59fc74f22887596ebde7e462d" "Advanced Portfolio")))

; Section: General

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Basis calculation method")))
  ((lambda (option) (if option ((gnc:option-setter option) 'filo-basis))) option))

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Date")))
  ((lambda (option) (if option ((gnc:option-setter option) '(relative . today)))) option))

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Price Source")))
  ((lambda (option) (if option ((gnc:option-setter option) 'pricedb-latest))) option))

(let ((option (gnc:lookup-option options
                                 "General"
                                 "Report name")))
  ((lambda (option) (if option ((gnc:option-setter option) "Advanced Portfolio Test"))) option))


; Section: Accounts


; Section: Display

(let ((option (gnc:lookup-option options
                                 "Display"
                                 "Show ticker symbols")))
  ((lambda (option) (if option ((gnc:option-setter option) #f))) option))

(let ((option (gnc:lookup-option options
                                 "Display"
                                 "Share decimal places")))
  ((lambda (option) (if option ((gnc:option-setter option) 0.0))) option))

(let ((option (gnc:lookup-option options
                                 "Display"
                                 "Show listings")))
  ((lambda (option) (if option ((gnc:option-setter option) #f))) option))

  options))
 (gnc:define-report 
  'version 1
  'name "Advanced Portfolio Test"
  'report-guid "c23fa84aeed37efe1f1b894d098ffd30"
  'parent-type "21d7cfc59fc74f22887596ebde7e462d"
  'options-generator options-gen
  'menu-path (list gnc:menuname-custom)
  'renderer (gnc:report-template-renderer/report-guid "21d7cfc59fc74f22887596ebde7e462d" "Advanced Portfolio")))

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Comment 7 Richard Ullger 2014-03-08 21:30:56 UTC
(In reply to comment #5)
> One more question as a result of comment 3:
> 
> Does your custom stylesheet still exist in Edit->Style Sheets ?

The custom stylesheet exists in Edit->Style Sheets and I can select it in the Stylesheets drop-down in report options and the report is generated using that stylesheet. But when the report is saved, the stylesheet setting is not saved with it.
Comment 8 lemur2009 2014-03-09 09:05:07 UTC
(In reply to comment #5)
> One more question as a result of comment 3:
> 
> Does your custom stylesheet still exist in Edit->Style Sheets ?

In my case it exists before I restart the program. After restarting it my custom stylesheet is no longer there.

GnuCash 2.6.2
Windows 7 SP1 32-bit
Comment 9 Geert Janssens 2014-03-09 19:28:07 UTC
@Richard: I found the cause of this issue. It was only manifesting itself when gnucash is compiled against guile 1.8. I was using guile 2 on my system. I have committed a fix in https://github.com/Gnucash/gnucash/commit/ce15a12356072be4a3149ee3e7cfc7952ec4a247

Can you test if this fixes your problem ?
Comment 10 Geert Janssens 2014-03-09 19:29:32 UTC
(In reply to comment #8)
> (In reply to comment #5)
> > One more question as a result of comment 3:
> > 
> > Does your custom stylesheet still exist in Edit->Style Sheets ?
> 
> In my case it exists before I restart the program. After restarting it my
> custom stylesheet is no longer there.
> 
> GnuCash 2.6.2
> Windows 7 SP1 32-bit

If the stylesheet is not even in the list of stylesheets anymore, this looks like another issue. What is the path to your home directory ? Does it contain some non-ascii characters perhaps ? And can you save a report configuration to the preconfigured reports ?
Comment 11 Richard Ullger 2014-03-09 20:48:07 UTC
(In reply to comment #9)
> @Richard: I found the cause of this issue. It was only manifesting itself when
> gnucash is compiled against guile 1.8. I was using guile 2 on my system. I have
> committed a fix in
> https://github.com/Gnucash/gnucash/commit/ce15a12356072be4a3149ee3e7cfc7952ec4a247
> 
> Can you test if this fixes your problem ?

Thanks Geert, your commit fixes my issue.
Comment 12 John Ralls 2018-06-29 23:24:02 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=721654. Please update any external references or bookmarks.