Adapt a built-in Report

From Gramps
Revision as of 03:19, 8 April 2021 by Bamaustin (talk | contribs) (See also)
Jump to: navigation, search
Gnome-important.png
🚧 Work In Progress

This wikipage is an outline from a template being roughed in. Please don't edit just yet. Instead, contribute suggestions on the Discussion page.

This page is not planned be linked to a public page until about 2 weeks after 8 April 2021.

If this notice remains after that date, please feel welcome to remove this notice and consider the content 'fair game' for unlimited editing.

Purpose

A question was posted to the Discourse forum wondering if there were tips somewhere for copying an internal Gramps report to a make an experimental add-on?

It seems like more people would be intrigued with the possibilities of tweaking reports without the risk of breaking a feature. Particularly one that they use often enough that tweaking it seemed like a good idea.

Making a duplicate add-on sidesteps putting the original at risk. However, there are differences between built-ins and 3rd party add-ons. It seemed like that might require at least converting the library paths and making a new .gpr.py registration file. What else?

A reply privately shared

In a private message, GaryG privately replied and sent a few copies of reports generated that address the question.

In the sample cases, Gary had taken the Detailed Ancestor and Detailed Descendant stock reports and added the ability to include *all* images for everyone. The Detailed individual report had that functionality, but the ancestor/descendant did not.


ch-ch-ch-changes

The important changes

  1. Change the Class names to be unique. Each report has 2 classes - one for the code and one for the report. In my cases, I added a trailing ‘i’.
  2. Change the name of the report styles. This is necessary if you are using books, not absolutely required if not. For the Descendant report I changed the style prefix from DDR to DDRI, for instance. I didn’t change the Ancestor report.
  3. Update the .gpr.py registration file to point to the correct file and correct classes.

Attaching are 2 samples with the old (names ending with report.py) and the new code (names ending with reporti.py) as well as the revised .gpr.py files. The old code may have changed since I wrote the new code quite a while ago - so every diff may not be important.

See also

Sample Report Specifications


(Section)

Stub, english (default)

Gramps-notes.png

This article's content is incomplete or a placeholder stub.
Please update or expand this section.


Gramps-notes.png

Ébauche

À compléter !

Si vous pouvez aider à la traduction ou l'adapter à la culture francophone.

N'hésitez pas à améliorer cette page.


Stub, french

Embeddable Snippets (Subsection)

Icons

Dashboard Dashboard
People People
Relationships Relationships
Family Family Families
Charts Charts
Events Events
Places Places
Geography Geography
Sources (v3.4.x) Sources
Citations Citations
Repositories Repositories
Media Media
Notes Notes
more of the standard icons

List object tools
STOCK_ADD STOCK_INDEX (used for share) STOCK_EDIT STOCK_REMOVE Symbol question.svg Symbol question.svg
Add Share Edit Remove Move
Upwards
Move
Downwards

Text formatting (Level 2 Subsection)

italic, bold, bold & italic

Images (Level 3 Subsection)
Fig. .1 A screenshot caption

Logo

Annotations of User Activities (Level 4 Subsection)
  • Commands you type at the command line
  • Filenames or Filenames
  • Replaceable text
  • Labels for buttons and other portions of the graphical interface
  • hint text for roll-over tooltip hints that identify elements of the graphical interface
  • Menu selections look like this: Menu ➡ Submenu ▶ Menu Item (always pad unicode symbols like these arrows with spaces so that robot translators see recognizable words)
  • Pop-up menu down arrowhead, (triangle) button
  • Buttons you can click
  • CTRL+D see Keybindings for a list of keyboard combinations used in Gramps.
  • Anything you type in
  • Checked - Selected Checkbox ☑ template
  • Unchecked - Checkbox that is ❏ unselected

Boxed annotations

Tango-Dialog-information.png
Title of Tip

Tips text.

Gramps-notes.png
Example Note

Notes text.

Gnome-important.png
WarningTitle/Heading

warning text