On Mon, 06 Dec 1999 10:29:22 +1100, the world broke into rejoicing as
Robert Graham Merkel <[EMAIL PROTECTED]> said:
> Dave Peticolas writes:
> >
> > > I think that gnome-print is probably the right way to go, but I'm not
> > > sure how long it's going to be before it's ready for prime time. Do
> > > you know, Dave?
> >
> > >From what I can extract from the gnome developer's site, the
> > gnome printing libraries will be in the 1.2 release of Gnome,
> > which has a target date of Sometime Soon. The status page on
> > the printing library indicates it is close to complete.
> >
> > > Actually, for printed output, another option to consider would be to
> > > generate scheme forms containing the data, and then just write some
> > > (trivial) converters that would spit out postscript, LaTeX, text, or
> > > whatever. This would be similar to the idea of defining a DTD and
> > > then using XML, but using XML would require additional dependences,
> > > whereas using scheme forms would be free, parser-wise.
> >
> > I think this is a good idea. btw, when you say 'scheme forms' do you
> > mean just standard s-expressions? Or is there something more elaborate
> > involved there?
>
> I think Rob B. is talking about standard s-expressions.
>
> I suggested something like this in a subsequent mail. If you guys
> think this more complex method is worth the additional complexity, I'd
> be very happy to go with it.
>
> Are we anywhere near a feature freeze? If we are, I'll hack together
> exporting the HTML to a HTML/PS convertor. This wouldn't take long at
> all, and would give us printing now.
>
> If not, I won't worry about that, and instead concentrate on the
> intermediate form idea.
I think this is very much the right idea; there is no doubt but that
there will be value to having a variety of output forms.
Creating what amounts to a "financial reporting language" that can
be used to push data at multiple output forms would be a *big* win.
The basic operators would include things like the following, which
I've added to report.scm as comments at this point...
;;; Suggested set of functions to manage report data in a
;;; device-independent manner.
;;; report-string, report-total, report-value are used to output
;;; values. "string" should be obvious; "value" will be a currency
;;; amount, and probably should be currency-aware. "total" allows
;;; a bunch of "values" to be collected into a single total "cell."
;;; The point to totals being distinct from values is that this allows
;;; the total to remain a dynamic calculation if, for instance, output
;;; is going into a spreadsheet.
;;;
;;; (define (report-string string indentation style))
;;; (define (report-value value collector-thunk column
;;; linkname style))
;;; (define (report-total input-collector-thunk
;;; output-collector-thunk column
;;; linkname style))
;;; You pass a list of the thunks established above into (report-line)
;;; which combines them into a single line.
;;; (define (report-line report-port . list-of-thunks))
;;;
;;; (define (define-report-total-collector))
;;; define-report-total-collector returns a thunk used by report-value
;;; and report-total to collect together values to establish a "total"
;;; In the case of HTML/Text output forms, this can just grab the
;;; values. In the case of a spreadsheet output form, this would
;;; collect up the cell IDs so that (report-total) would generate a
;;; formula like "=D2+D3+D4+D5+...+D15"
;;; (define (report-start-section report-port linkname))
;;; (define (report-end-section report-port))
;;; These functions are necessary for the HTML output form to generate
;;; the table start/end info. It would not be a bad move to change
;;; this to:
;;; (define (report-start-section report-port linkname . list-of-thunks))
;;; that works like (report-line), so that the first line in the table
;;; can contain header data.
;;; style:
(define style-structure
(make-record-type
"style"
'(alignment fontinfo color)))
;;; (define (report-newpage) report-port)
;;; Jump to a new page... More-or-less a no-op with HTML, but could
;;; do a switch to a new sheet with Gnumeric...
;;; (define (report-open physical-port title medium
;;; page-dimensions collist))
;;; This "opens" the report, associating it with a "physical" port,
;;; indicating a title, medium (e.g. - 'html 'text 'gnumeric
;;; 'postscript ...),
;;; page dimensions such as:
;;; (80 'cols 66 'rows) - Common text formats
;;; (132 'cols 66 'rows)
;;; (8.5 'in 11 'in) - Likely useful for Postscript
;;; (8.5 'in 14 'in)
;;; (0 'generic 0 'generic) - For formats with no fixed limits
;;; like HTML/Spreadsheet
;;; collist is a list of columns:
;;; ('text (1 55) (57 10) (69 10)) -- For use with text
;;; - This describes 3 cols, one 55 chars wide, and 2 of width 10.
;;; Good for a report that is to have 2 numeric columns
;;; ('html (8 'in) ((5 'in) (1.5 'in) (1.5 'in)))
;;; - Hopefully obvious?
;;; ('html (8 'in) (('rest) (1.5 'in) (15 'percent)))
;;; (15 'percent) is equivalent to 15% of 8 'in, e.g. (1.2 'in)
;;; ('rest) takes up the "rest" of the width, in this case, (5.3 in)
;;; ('columns 3)
;;; Good for a spreadsheet; indicates that there are three columns.
;;; It might be nice for this to add further options to configure
;;; the widths of these columns...
;;;
;;; (define (report-close report-port))
;;; This cleans up the data structures so that they may be
;;; garbage-collected.
;;;
;;; (define (report-page-header report-port thunk))
;;; (define (report-page-footer report-port length thunk))
;;;
;;; These two functions attach thunks that do stuff at the top and
;;; bottom of each page. The footer needs to know how its length so
;;; that (report-need) can be aware of this in determining how close
;;; to the bottom of the page it can safely get...
;;;
;;; (define (report-need report-port need-amount))
;;; This function indicates that if there aren't "need-amount" lines
;;; left on the present page, the system should display the footer and
;;; jump on to the next page... Note that in the "body," this will
;;; add in the number of lines that the footer produces...
;;; (define (report-newpage) report-port)
--
If all the economists in the world were laid end to end, it would
probably be a good thing.
[EMAIL PROTECTED] - <http://www.hex.net/~cbbrowne/lsf.html>
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]