Changes

From Gramps

Report-writing tutorial

35 bytes added, 15:43, 22 November 2025
m
Report class: Fixed all hyperlinks
</pre>
The Report class's constructor will initialize several variables for the user based off the passed values. They are:
;self.doc : The opened document instance ready for output. This is of the type [https://gramps-project.org/docs/gen/gen_plug.html#module-gramps.gen.plug._docgenplugin docgen], and is '''not''' a normal file object.;self.database : The [httphttps://www.gramps-project.org/docs/gen/gen_libgen_db.html#module-gramps.gen.lib db.base GrampsDbBase] database object.;self.options_class : The [httphttps://www.gramps-project.org/docs/gen/gen_plug.html#module-gramps.gen.plug._docgenplugin report._options.ReportOptions ReportOptions] class passed to the report.
You'll probably need a start-person for which to write the report. This person should be obtained from the <tt>options_class</tt> object through the PersonOption class which will default to the active person in the database. Anything else the report class needs in order to produce the report should be obtained from the <tt>options_class</tt> object. For example, you may need to include the additional code in the report class constructor to obtain any options you defined for the report.
65
edits

Navigation menu