style="width:70%; border:1px solid #ccc; padding:0" align="center"| -| style="width: 10px; background-color:#c00000" | | style="width:60px" align="center"| [[ Image:Gnome-important.png| 40px]] | style="width:90%" align="left" | '''This is still a draft. Please don't link to it yet!''' |}
GRAMPS there are six different types of reports.
* Text report
* Graphical report
Book report* Code generators* Web page generator * View only reportOnly Text reports and Graphical reports use the Report (Document) API, since the latter three directly write their output into file(s) or onto the screen, while Book reports are simply combination of Text reports and Graphical reports.
At the moment the combination of textual and graphical elements within one document is not supported (for future plans refer to
[[Report API redesign ]]), thus Text and Graphical reports are implemented via separate APIs, though they have a common part.This common part is implemented in the [http://www.gramps-project.org/ api3/ BaseDoc.BaseDoc -class.html BaseDoc class], which contains among others basic document opening, closing, and stylesheet handling methods. It also stores the physical description of a page (sheet of paper in print).
'''Note! ''' The <tt>BaseDoc.open</tt> and the <tt>BaseDoc.close</tt> methods have to be implemented by the subclassed document generators.
thumbnail]] Description of the paper, which every report will be rendered on, is stored by an instance of the [http://www.gramps-project.org/ api3/ BaseDoc.PaperStyle -class.html PaperStyle class]. This instance is available via the <tt>BaseDoc.paper_style</tt> class attribute. The chosen PaperStyle is given to the document generator at initialization, and is handled by the reporting framework.
The <tt>PaperStyle</tt> holds information on the size of the paper ([http://www.gramps-project.org/
api3/ BaseDoc. PaperSize-class. html PaperSize class] instance), the size of the margins, and the orientation of the paper. Use the proper accessor methods to get the values. To get the metrics of the usable area of a page (page without the margins) one can also use the [http://www.gramps-project.org/ api3/ BaseDoc.PaperStyle -class. html#get_usable_width PaperStyle.get_usable_width] and [http://www.gramps-project.org/ api3/ BaseDoc.PaperStyle -class. html#get_usable_height PaperStyle.get_usable_height] convenience methods. Width and height are always given according to the orientation of the paper, thus width is always the horizontal, and height is always the vertical dimension.
Text reports do not need to care about paper properties, as the document generator (or the external viewer) paginates the report according to those properties. While, on the other hand, graphical reports do need to take paper properties into account when creating graphical elements, i.e. they should not draw on the margins.
The origin of the coordinate system is the top left corner of the usable area.
<br clear="all" />
==Text document API==
Graphical document API==