Changes

Jump to: navigation, search

Report-writing tutorial

284 bytes added, 12:08, 12 September 2021
m
Typo in code variable name : "fist" instead of "first"
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.
* [[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]]
3,060
edits

Navigation menu