Changes

Jump to: navigation, search

Report-writing tutorial

566 bytes added, 12:08, 12 September 2021
m
Typo in code variable name : "fist" instead of "first"
* The most common surname
As of {{man tip|From Gramps version 3.2, there is also a |A [[Simple Access API|simple access]] database [https://www.gramps-project.org/docs/ API] available, with accompanying [[Quick Views]], [[Gramplets]] and [[Addons development|Addons]].}}
==Overview==
Paragraph and font styles are defined in the <tt>make_default_style()</tt> function of the options class. The paragraphs are grouped into a <tt>StyleSheet</tt>, which the <tt>make_default_style()</tt> function defines. For the example report (<tt>DbSummary</tt>), the paragraph styles are defined as below:
{{stub}}<!-- need to check code is correct for Gramps 5.1.x -->
compare to <code>gramps\plugins\textreport\summary.py</code> starting at [https://github.com/gramps-project/gramps/blob/master/gramps/plugins/textreport/summary.py#L297 line 297]
<pre>
def make_default_style(self, default_style):
# Options specific for this report
self.options_dict = {
'my_fist_optionmy_first_option' : 0,
'my_second_option' : '',
}
self.options_help = {
'my_fist_optionmy_first_option' : ("=num","Number of something",
[ "First value", "Second value" ],
True),
** translated name (the one to display in menus)
** modes that should be enabled for the report (standalone, book item, command line)
* If the report requires an active person to run, then <code>require_active </code> should be set to <code>True</code>.
* Finally, both report class and options class should be passed to registration.
description = _("Produces a ..."),
version = '1.0',
gramps_target_version = '35.21',
status = STABLE,
fname = 'filename.py',
See an existing book report for more details.
 
== Manually installing your report ==
Install in the plugins directory of your Gramps user directory.
 
== Example output ==
Start Gramps and your tutorial report will be available from the reports menu as ....
 
Run the report and this is what the output looks like ....
==See also==
* [[Report_API|Report API]]
* [[Report_Generation|Report Generation]] (describing output format options)* [[Gramps_Data_Model|Gramps Data Model]]
[[Category:Addons]]
[[Category:Developers/General]]
[[Category:Developers/Tutorials]]
[[Category: Plugins]]
[[Category:Reports]]
4,529
edits

Navigation menu