2000-09-05 06:55:43 +00:00
|
|
|
@node Reports, User Preferences, Register, Top
|
2000-07-17 08:26:56 +00:00
|
|
|
@chapter Reports
|
2001-05-09 08:55:39 +00:00
|
|
|
@cindex Reports
|
|
|
|
|
|
2007-09-02 20:18:54 +00:00
|
|
|
@strong{This whole document is completely outdated. Don't read this. All
|
|
|
|
|
function names and every described structure has changed
|
|
|
|
|
completely. Only read this if you want to know how gnucash looked like
|
|
|
|
|
in 1999. This is completely outdated!}
|
|
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
The reporting infrastructure is designed facilitate the creation
|
|
|
|
|
of sophisticated reports including tables, graphs, and hyperlinks.
|
|
|
|
|
The infrastructure includes functionality to support the following:
|
|
|
|
|
|
|
|
|
|
@itemize
|
|
|
|
|
|
|
|
|
|
@item
|
|
|
|
|
Creation of tables, with headings, subheadings, totals, and subtotals.
|
|
|
|
|
|
|
|
|
|
@item
|
|
|
|
|
Formatting of dates & numbers.
|
|
|
|
|
|
|
|
|
|
@item
|
|
|
|
|
Currency conversions.
|
|
|
|
|
|
|
|
|
|
@item
|
2007-10-28 13:26:45 +00:00
|
|
|
Creation of graphs such as pie and bar charts.
|
2001-05-09 08:55:39 +00:00
|
|
|
|
|
|
|
|
@item
|
|
|
|
|
Creation of hyperlinks to other reports and to other GnuCash
|
|
|
|
|
objects such as registers.
|
|
|
|
|
|
|
|
|
|
@end itemize
|
|
|
|
|
|
|
|
|
|
@menu
|
|
|
|
|
* Creating a Report::
|
|
|
|
|
@end menu
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@node Creating a Report, , Reports, Reports
|
|
|
|
|
@section Creating a Report
|
2000-08-11 19:32:34 +00:00
|
|
|
|
|
|
|
|
To define a report, your report must have
|
|
|
|
|
|
|
|
|
|
@code{(gnc:support <your_report_name>)}
|
|
|
|
|
|
|
|
|
|
and should have
|
|
|
|
|
|
|
|
|
|
@code{(gnc:depend "report-utilities.scm")}
|
|
|
|
|
|
|
|
|
|
as well as
|
|
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
@code{(gnc:depend "report-html.scm")}
|
2000-08-11 19:32:34 +00:00
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
if you wish to use the html generation facilities. You should
|
|
|
|
|
avoid creating HTML directly wherever possible.
|
2000-08-11 19:32:34 +00:00
|
|
|
|
|
|
|
|
To autoload your report, you should add the line @code{(gnc:depend
|
|
|
|
|
<your_report_name>)} to the file @file{src/scm/report/report-list.scm}.
|
|
|
|
|
|
|
|
|
|
@code{(gnc:depend "date-utilities.scm")}
|
|
|
|
|
|
|
|
|
|
has lots of date-manipulation functions you'll almost certainly need.
|
|
|
|
|
|
|
|
|
|
To define a report, you call @code{(gnc:define-report)}. This function
|
|
|
|
|
can accept a variable number of arguments, but at the moment four
|
2001-05-09 08:55:39 +00:00
|
|
|
distinct arguments are recognised, as in the following from
|
2000-08-11 19:32:34 +00:00
|
|
|
the transaction report:
|
|
|
|
|
|
|
|
|
|
@example
|
|
|
|
|
(gnc:define-report
|
|
|
|
|
'version 1
|
2001-05-09 08:55:39 +00:00
|
|
|
'name (N_ "Transaction Report")
|
2000-08-11 19:32:34 +00:00
|
|
|
'options-generator trep-options-generator
|
2001-05-09 08:55:39 +00:00
|
|
|
'renderer trep-renderer)
|
2000-08-11 19:32:34 +00:00
|
|
|
@end example
|
|
|
|
|
|
|
|
|
|
@table @code
|
|
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
@item version
|
2000-08-11 19:32:34 +00:00
|
|
|
This is the version number of the report, which is currently ignored.
|
|
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
@item name
|
|
|
|
|
This is the name of the report. It should be marked as translatable,
|
|
|
|
|
but the name should be given in untranslated form, hence the use of
|
|
|
|
|
@code{(N_ )}.
|
2000-08-11 19:32:34 +00:00
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
@item options-generator
|
2000-11-18 02:27:08 +00:00
|
|
|
This should be a function that takes no arguments and returns an options
|
2001-05-09 08:55:39 +00:00
|
|
|
structure with the options for the report. The options interface is
|
2000-11-18 02:27:08 +00:00
|
|
|
currently not fully documented, but should be.
|
|
|
|
|
|
2001-05-09 08:55:39 +00:00
|
|
|
@item renderer
|
|
|
|
|
This is the function which renders the HTML.
|
2000-08-11 19:32:34 +00:00
|
|
|
|
|
|
|
|
@end table
|