> > Anyway Rob, now that I have this working, can you tell me how I can
> > get the scheme reports to pass the html to gnome as one large string?
> 
> Well, I don't offhand about the gnome bit, but to get the output as a
> long string instead of having it display (which I presumed we'd need
> to do eventually), you just need to redefine the gnc:run-report
> function.  As I mention in the comment in the current code,
> call-with-output-string will let us use the normal output functions to
> build a string.  Perhaps something like this (I haven't tested it, so
> let me know if it doesn't work):

If I can just get the string, I can take it from there.
I tried this version of your function:

(define (gnc:run-report report-name)
  ;; Return a string consisting of the contents of the report.

  (define (display-report-list-item item port)
    (cond
     ((string? item) (display item port))
     ((null? item) #t)
     ((list? item) (map display-report-list-item item port))
     (else (gnc:warn "gnc:run-report - " item " is the wrong type."))))

  (let ((rendering-thunk (hash-ref *gnc:_report-info_* report-name)))
    (if (not rendering-thunk)
        #f
        (call-with-output-string
         (lambda (port)
           (for-each
            (lambda (item) (display-report-list-item item port))
            (rendering-thunk)))))))

which is the same as the one you sent, except for the recursive
call where I added the 'port' parameter. It fails with

ERROR: null-pair?: argument out of domain #<output: string 8194e40>

It's failing on the P&L and balance reports when it gets to
the nested list of strings bound to the 'output' variable in
the balance-and-pnl.scm file.

I'm going to play around with it, but if you see the problem
offhand, that would be great.

dave

--
Gnucash Developer's List 
To unsubscribe send empty email to: [EMAIL PROTECTED]

Reply via email to