Index: src/report/report-system/report.scm
===================================================================
--- src/report/report-system/report.scm	(Revision 17746)
+++ src/report/report-system/report.scm	(Arbeitskopie)
@@ -469,6 +469,24 @@
     #f "  (gnc:restore-report-by-guid ~S ~S ~S options))\n"
     (gnc:report-id report) (gnc:report-type report) (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))))
 
+;; Loop over embedded reports and concat result of each gnc:report-generate-restore-forms
+(define (gnc:report-generate-options-embedded report)
+  (let*
+      ((embedded-reports (gnc:report-embedded-list report))
+       (result-string ""))
+    (if embedded-reports
+        (for-each
+         (lambda (subreport-id)
+           (let*
+               ((subreport (gnc-report-find subreport-id))
+                (subreport-options-text (gnc:report-generate-restore-forms subreport)))
+             (set! result-string (string-append
+                                  result-string
+                                  ";;;; Options for embedded report\n"
+                                  subreport-options-text))))
+         embedded-reports))
+    result-string))
+
 (define (gnc:report-generate-saved-forms report)
   ;; clean up the options if necessary.  this is only needed 
   ;; in special cases.  
@@ -488,6 +506,8 @@
     #f "(let ()\n (define (options-gen)\n  (let ((options (gnc:report-template-new-options/report-guid ~S ~S)))\n"
     (gnc:report-type report) (gnc:report-template-name (hash-ref *gnc:_report-templates_* (gnc:report-type report))))
    (gnc:generate-restore-forms (gnc:report-options report) "options")
+   ;; get options of embedded reports
+   (gnc:report-generate-options-embedded report)
    "  options))\n"
    (simple-format 
     #f " (gnc:define-report \n  'version 1\n  'name ~S\n  'report-guid ~S\n  'parent-type ~S\n  'options-generator options-gen\n  'menu-path (list gnc:menuname-custom)\n  'renderer (gnc:report-template-renderer/report-guid ~S ~S)))\n\n"
