On Sun, 21 Nov 1999 20:59:53 CST, the world broke into rejoicing as
[EMAIL PROTECTED]  said:
> It's been rumoured that Rob Browning said:
> > 
> > "Rob Coker" <[EMAIL PROTECTED]> writes:
> > 
> > > While I've put my $0.02 on everything else, I'll add that I'd really
> > > like to see the native format of reports to be text (preferably
> > > comma delimited).  One could site all the unix-philosophy reasons
> > > for doing it this way, but the bottom line for me is that I can then
> > > use any spreadsheet to format it however I want.
> > 
> > Hmm, I'm not sure what you mean by the "native report format".  When a
> > report is generated, it's just spit out as html.  Generating
> > comma-delimited data would be a separate (though similar) process.  If
> 
> My vision for having the html reports is that gnucash could supply a
> default 5 or 10 reports, and then allow users to create hundreds of 
> custom report 'filters'.  If one of these was CSV, that shouldn't be a
> problem.
> 
> Note that the abopve vision has to have some way of allowing the user to
> specify a custom filter that they created.

When spitting out HTML, I'd *strongly* urge doing something like what
is attached below.

The critical things to note have to do with the metadata that I'm
attaching to the various tags:

1) Up top, information presents in pretty full detail the nature of
the report in terms that could be parsed out by searching metatags.
What I've got there is incomplete; there should be metadata included
to indicate such things as:
  --> When the report was generated;
  --> If there are 15 different reports, which of those reports it is;
  --> The selection criteria used to generate the report.

2) There are CLASS and ID tags in the body.  These allow some notable
things:
  --> The ID allows having links between transaction components, so
      that if there happens to be both sides to a transaction in a
      report, you *could* have <A HREF="#T12341821"> Salary </a> to
      link back to it.
  --> By having an ID, this offers a route for the HTML browser to
      (perhaps) "drill" back to GnuCash.  e.g. - you double-click on
      the transaction, and GnuCash jumps to that specific transaction.
      Yes, this involves some "rocket science."  That ID needs to be
      like unto a CORBA IOR, a somewhat permanent ID for the split, in
      order for this to work.
  --> The "class" provides the ability to have a CSS file that
      controls how the data is rendered.  This could provide a way of
      allowing the user to control this; you go to a dialog that
      allows properties to be set for different report classes for
      different fields, and this would result in generating custom CSS
      files.
  --> CLASS info can be used to "publish" what the data in a particular
      field is supposed to be.  THAT means that someone that parses
      the HTML file can infer what is in a given field with much
      greater confidence.  This amounts to getting much of the
      benefits of XML, "for free."

Suggestion: There probably should be a function set up for each field
the engine has that can render it.

Thus:
  enum { HTML, TEXT, XML, RDB };

  struct output_form {
    int type;
    /* Possibly with openings for extra data structures should they be
       needed, or with further different behaviours based on which
       report is being written */  
  }
  /* Rendering functions */
  char *render_split_amount(Split *split, struct output_form);
  char *render_split_memo(Split *split, struct output_form);
  char *render_split_description(Split *split, struct output_form);

By keeping an API in the way, this encourages the multiple output
forms to have some similar behaviour...

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<meta name="GENERATOR" content="GnuCash version 3.2">
<link rel="stylesheet" title="normal" type="text/css" href="gc.css">
<LINK rel=top href="general-ledger.html">
<LINK rel=glossary href="http://www.gnucash.org/glossary.html">
<title>Sample Report </title>
<META NAME="Author" CONTENT="Christopher B. Browne">
<meta formatter="insert_html_templates, by Christopher B. Browne">
<body bgcolor=white text=black link=red vlink=maroon alink=fuchsia>

<TABLE border="1" class="TXNDETAILTABLE"> 
<tr>
<th align="LEFT" valign="TOP"> Date </th>
<th align="LEFT" valign="TOP"> ID </th>
<th align="LEFT" valign="TOP"> Description </th>
<th align="LEFT" valign="TOP"> Category </th>
<th align="LEFT" valign="TOP"> Amount </th>
<th align="LEFT" valign="TOP"> Reconciled? </th>
</tr>
<tr class="TXNDETAIL" id="T12341821">
<td align="RIGHT" class="DATEYYYYMMDD"> 1999/01/01 </td>
<td align="LEFT" class="ITEMCODE"> DDP </td>
<td align="LEFT" class="DESCR"> Salary </td>
<td align="LEFT" class="ACCOUNT"> Salary </td>
<td align="RIGHT" class="CURRENCY"> 1450.72 </td>
<td align="RIGHT" class="RECONCILED"> C </td>
</tr>
<tr class="TXNDETAIL" id="T12341241">
<td align="RIGHT" class="DATEYYYYMMDD"> 1999/01/02 </td>
<td align="LEFT" class="ITEMCODE"> 102 </td>
<td align="LEFT" class="DESCR"> Joe the Landlord </td>
<td align="LEFT" class="ACCOUNT"> Rent </td>
<td align="RIGHT" class="CURRENCY"> 600.00 </td>
<td align="RIGHT" class="RECONCILED"> C </td>
</tr>
<tr class="TXNDETAIL" id="T12142841">
<td align="RIGHT" class="DATEYYYYMMDD"> 1999/01/03 </td>
<td align="LEFT" class="ITEMCODE"> 103 </td>
<td align="LEFT" class="DESCR"> Texas Water Source </td>
<td align="LEFT" class="ACCOUNT"> Water </td>
<td align="RIGHT" class="CURRENCY"> 25.00 </td>
<td align="RIGHT" class="RECONCILED"> </td>
</tr>
<tr class="TXNDETAIL" id="T22842241">
<td align="RIGHT" class="DATEYYYYMMDD"> 1999/01/05 </td>
<td align="LEFT" class="ITEMCODE"> ATM </td>
<td align="LEFT" class="DESCR"> ATM Withdrawal </td>
<td align="LEFT" class="ACCOUNT"> ATM </td>
<td align="RIGHT" class="CURRENCY"> 100.00 </td>
<td align="RIGHT" class="RECONCILED"> </td>
</tr>
<tr class="TXNDETAIL" id="T242822141">
<td align="RIGHT" class="DATEYYYYMMDD"> 1999/01/09 </td>
<td align="LEFT" class="ITEMCODE"> ATM </td>
<td align="LEFT" class="DESCR"> ATM Withdrawal </td>
<td align="LEFT" class="ACCOUNT"> ATM </td>
<td align="RIGHT" class="CURRENCY"> 120.00 </td>
<td align="RIGHT" class="RECONCILED"> * </td>
</tr>
</TABLE>
</HTML>

--- gc.css ---
/* Style Sheet */
/* $Id: stdstyle.css,v 1.3 1998/09/19 13:55:04 cbbrowne Exp cbbrowne $ */

BODY{ background-color:#EEFFEE; 
background-image: url(http://www.berlin-consortium.org/background.gif);
background-repeat: repeat-y;}

/* Apologies to Berlin folk; I'll soon fiddling with this further to cut
   down on their traffic... */

SPAN.indent{margin-left:0.4in;}

/* This may be a bit excessively loud... */
H1, H2, H3, H4 {font-family: Optima, Lucida, Helvetica, sans-serif; color:
green; background-color: transparent; font-weight: bolder; }

/* Utopia, Helvetica, Optima, Lucida Typewriter */

H1{ font-size: 18pt;}
H2{ font-size: 16pt;}
H3{ font-size: 14pt;}
H4{ font-size: 12pt;}

/* And make the main title big, centre it */ 

H1.title {font-size: 24pt; text-align: center; color: maroon;
background-color: transparent; font-family: Optima, Lucida, Helvetica,
sans-serif;}

/* Similarly, fiddle with address info at the top of the page */
P.author, P.affiliation {font-weight:bold; font-family: Optima, Helvetica,
Arial, Sans-serif; text-align: center;}

P.affiliation {font-size: 8pt}

DEL {font-weight: bold}
INS {background-color: white}

/* Fiddle with the headers; shrink left/right stuff, grow the main title */
DIV.NAVHEADER TH {font-size: larger;}
DIV.NAVFOOTER TH {font-size: larger;}
DIV.NAVFOOTER TD {font-family: Helvetica,Arial,sans-serif; font-size: smaller;}
DIV.NAVHEADER TD {font-family: Helvetica,Arial,sans-serif; font-size: smaller;}

/* DocBook Table of Contents handling */
DIV.TOC {font-size: 8pt; text-indent: 3em;}
P.TOC {font-size: 8pt; text-indent: 3em;}

B.COMMAND {font-family: courier,monospace; font-weight: normal;}

/* Zowie way of presenting PRE stuff */

PRE,TT.LITERAL,P.LITERALLAYOUT{ font-family:Lucida Typewriter, Courier,
monospace; font-weight: normal; background-color: gray; color: white;
border-width: thin; white-space:pre; }

/* Color selection: 
    aqua black blue fuchsia gray green lime maroon navy
    olive purple red silver teal white yellow */

TABLE.TXNDETAILTABLE {
  background-color lime;
}
DATEYYYYMMDD {
  color: olive;
}
--
"Without insects, our ecosystem would collapse and we would all die. In
that respect, insects are far more important than mere end-users."
-- Eugene O'Neil <[EMAIL PROTECTED]>
[EMAIL PROTECTED] - <http://www.ntlug.org/~cbbrowne/lsf.html>

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

Reply via email to