~ubuntu-branches/ubuntu/hoary/gnucash/hoary

« back to all changes in this revision

Viewing changes to src/doc/design/reports.texinfo

  • Committer: Bazaar Package Importer
  • Author(s): James A. Treacy
  • Date: 2002-03-16 14:14:59 UTC
  • Revision ID: james.westby@ubuntu.com-20020316141459-wtkyyrpfovryhl1s
Tags: upstream-1.6.6
ImportĀ upstreamĀ versionĀ 1.6.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
@node Reports, User Preferences, Register, Top
 
2
@chapter Reports
 
3
@cindex Reports
 
4
 
 
5
The reporting infrastructure is designed facilitate the creation
 
6
of sophisticated reports including tables, graphs, and hyperlinks.
 
7
The infrastructure includes functionality to support the following:
 
8
 
 
9
@itemize
 
10
 
 
11
@item
 
12
Creation of tables, with headings, subheadings, totals, and subtotals.
 
13
 
 
14
@item
 
15
Formatting of dates & numbers.
 
16
 
 
17
@item
 
18
Currency conversions.
 
19
 
 
20
@item
 
21
Create of graphs such as pie and bar charts.
 
22
 
 
23
@item
 
24
Creation of hyperlinks to other reports and to other GnuCash
 
25
objects such as registers.
 
26
 
 
27
@end itemize
 
28
 
 
29
@menu
 
30
* Creating a Report::           
 
31
@end menu
 
32
 
 
33
 
 
34
@node Creating a Report,  , Reports, Reports
 
35
@section Creating a Report
 
36
 
 
37
To define a report, your report must have 
 
38
 
 
39
@code{(gnc:support <your_report_name>)}
 
40
 
 
41
and should have
 
42
 
 
43
@code{(gnc:depend "report-utilities.scm")}
 
44
 
 
45
as well as
 
46
 
 
47
@code{(gnc:depend "report-html.scm")}
 
48
 
 
49
if you wish to use the html generation facilities. You should
 
50
avoid creating HTML directly wherever possible.
 
51
 
 
52
To autoload your report, you should add the line @code{(gnc:depend
 
53
<your_report_name>)} to the file @file{src/scm/report/report-list.scm}.
 
54
 
 
55
@code{(gnc:depend "date-utilities.scm")}
 
56
 
 
57
has lots of date-manipulation functions you'll almost certainly need.
 
58
 
 
59
To define a report, you call @code{(gnc:define-report)}. This function
 
60
can accept a variable number of arguments, but at the moment four
 
61
distinct arguments are recognised, as in the following from
 
62
the transaction report:
 
63
 
 
64
@example
 
65
  (gnc:define-report
 
66
   'version 1
 
67
   'name (N_ "Transaction Report")
 
68
   'options-generator trep-options-generator
 
69
   'renderer trep-renderer)
 
70
@end example
 
71
 
 
72
@table @code
 
73
 
 
74
@item version
 
75
This is the version number of the report, which is currently ignored.
 
76
 
 
77
@item name
 
78
This is the name of the report. It should be marked as translatable,
 
79
but the name should be given in untranslated form, hence the use of
 
80
@code{(N_ )}.
 
81
 
 
82
@item options-generator
 
83
This should be a function that takes no arguments and returns an options
 
84
structure with the options for the report. The options interface is
 
85
currently not fully documented, but should be.
 
86
 
 
87
@item renderer
 
88
This is the function which renders the HTML.
 
89
 
 
90
@end table