Detailed Textreports with pictures possible?

Hello, I work with Gramps 5.2.3 on Linux Mint DE 6.
As I am from Germany and I use the german Gramps version, I try to translate all program related stuff as good and correct as possible.
I make citations for all relevant personal dates (Birth, baptism, wedding, death…) and use the Gramp programm parts for it.
I save pictures of the records in the media gallery as well, so for example, I have a photo/scan of birth records, which I found in churchbook “A-town” in year “xxxx” under number “nnnn”. I reference the scans with the corresponding event.
When I generate a standard website report in Gramps and include the soures and media, I get correct footnotes and can see the images of the record, too.
But when I make textreports, such as a detailed ascendents report I only get correct footnotes but without pictures (see attached picture)


Is there any possibility that the picture of a record is displayed in the footnote as well?
Any idea or help is appreciated, and of course any follow up questions will be answered.
Thanks in advance!

There’s an add-on text report “Detailed Descendant Report with All Images”. Maybe this will solve your problem?

@csam
I know this AddOn, it did not solve my problem, but I will try again tonight and send a confirmation later on…

@csam
I was not right. This report is not working on my system.
Please see attached Error details:

3539018: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'

Looks like that is issue 13544 reported in December 2024, and only happens when “The report does not run when the “Include sources” checkbox is ticked

1 Like

@Gioto
You are right. I included everything except sources and it ran through.
And I made a cross check and I excluded everything except sources and it did not run.

I am not so familiar with development, but I offer to check bugfixes, if it is not too complicated to modify my live gramp system!

May I suggest that the first step is to clone the broken INTERNAL Report as a local add‐on with a unique ID and Name for experimentation… this ensures that the base report can be left unmolested.

@emyoulation
Brian, I am not sure, what you mean exactly.
Did you mean, that I create my own gramps bug report?
Then here it is…

User Information:

Error Details:

14593: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'
227218: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'
314574: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'
559309: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'
3384126: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/gramps/gui/plug/report/_reportdialog.py", line 760, in report
    my_report.write_report()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "/home/michael/.local/share/gramps/gramps52/plugins/DetDescendantReport-images/detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'

System Information:

Gramps version: 5.2.3
Python version: 3.11.2
BSDDB version: 6.2.9 (5, 3, 28)
sqlite version: 3.40.1 (2.6.0)
LANG: de_DE.UTF-8
OS: Linux
Distribution: 6.1.0-32-amd64

GTK version : 3.24.38
gobject version: 3.42.2
cairo version : (1, 20, 1)

@emyoulation
I tried the same with a Gramps 5.2.3 Version on Windows 10. The report fails there, too.
Please see also my detailed bug report.

User Information:

Error Details:

12026: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
  File "C:\Users\Michael.Schieder\Gramps\gramps\gui\plug\report\_reportdialog.py", line 760, in report
    my_report.write_report()
  File "C:\Users\Michael.Schieder\AppData\Local\gramps\gramps52\plugins\DetDescendantReport-images\detdescendantreporti.py", line 332, in write_report
    self.write_endnotes_with_media()
  File "C:\Users\Michael.Schieder\AppData\Local\gramps\gramps52\plugins\DetDescendantReport-images\detdescendantreporti.py", line 1052, in write_endnotes_with_media
    doc.write_text(endnotes._format_source_text(source, elocale), links=links)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'

System Information:

Gramps version: AIO64-5.2.3-r1-aa03f5a
Python version: 3.11.9
BSDDB version: 6.2.9 (6, 0, 30)
sqlite version: 3.46.0 (2.6.0)
LANG: de_DE.UTF-8
OS: Windows

GTK version : 3.24.43
gobject version: 3.48.2
cairo version : (1, 26, 1)

@emyoulation /@Gioto
I have even more news.
I set up a virtual machine with Windows 10 and installed Gramps 6 there, so that there is no interference with my “live” system. Then I moved a copy of my live database and media directory to the VM, updated the DB and tried again, making a report.
The problem occurs on Gramps 6, too.

I know, that all over Gramps, this is a minor issue, bit I encourge everybody to try to find a fix.
And certainly I offer my help for necessary tests.

Here also the bugreport, created with Gramps 6.

User Information:

Error Details:

95086: WARNING: upgrade.py: line 2310: If upgrade and loading the Family Tree works, you can delete the zip file at C:\Users\Automation\Documents\Schieder_2025-04-03_13-02-15.zip
286656: ERROR: _reportdialog.py: line 801: Failed to run report.
Traceback (most recent call last):
File “C:\Program Files\Gramps\gramps\gui\plug\report_reportdialog.py”, line 760, in report
my_report.write_report()
File “C:\Users\Automation\AppData\Roaming\gramps\gramps60\plugins\DetDescendantReport-images\detdescendantreporti.py”, line 332, in write_report
self.write_endnotes_with_media()
File “C:\Users\Automation\AppData\Roaming\gramps\gramps60\plugins\DetDescendantReport-images\detdescendantreporti.py”, line 1052, in write_endnotes_with_media
doc.write_text(endnotes._format_source_text(source, elocale), links=links)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module ‘gramps.gen.plug.report.endnotes’ has no attribute ‘_format_source_text’

System Information:

Gramps version: AIO64-6.0.0–1
Python version: 3.12.9
BSDDB version: 6.2.9 (6, 0, 30)
sqlite version: 3.47.2
orjson version: 3.10.15
LANG: de_DE.UTF-8
OS: Windows

GTK version : 3.24.49
gobject version: 3.52.3
cairo version : (1, 27, 0)

This was broken with commit: Commit 65a79c7
which removed the procedure _format_source_text and _format_ref_text from gen/plug/report/endnotes.py

on July 2023.

I think @Nick-Hall will need to review as he did this commit.

I updated bug report with this same info: 0013544: DetailedDescendantReport/images[AttributeError: module 'gramps.gen.plug.report.endnotes' has no attribute '_format_source_text'] - Gramps - Bugtracker – Free Genealogy Software

1 Like

The _format_source_text method was moved into a plugin. Methods that start with an underscore are protected and do not form part of the public API.

Created PR Fix reference to _format_source_text in DetailedDescendantReport with Images by GaryGriffin · Pull Request #701 · gramps-project/addons-source · GitHub to fix this issue. Please test and provide feedback.

2 Likes

@GaryGriffin
I downloaded your fix and copied it in my VM with Windows 10 and Gramps 6.
Means, I replaced the whole file detdescendantreporti.py
There, the report is running through and it is inserting pictures as expected.
It also works with Gramps 5.2.3 on Linux Mint DE6. :star_struck: :clap:
Excellent job!!!
The only issue, the picture is in a thumbnail size and not large enough to read.
Is there a chance to scale it up to side width or a user definded size?
Please see attached screenshot. The picture is as blured as in my screenshot.
I wiped out some data, because its live data…

This report is based on the Individual Report. Both reports are hard-coded to generate a gallery table that is 3 images wide (each image 5x5 cm).

I suggest you submit a Feature Request to make this (images per row, size of image) an option. It would be for all images in the report.

If you want to tweak this in your personal copy, then the code you have to change:

line 966: change 3 to the number of images per row
line 992: change ‘center’ to ‘single’; change 5.0 as appropriate. 15.0 would make single images that are readable.

1 Like

What about with HTML file format set (Textual reports)?

I prefer Gary‘s idea of a tweak and a feature request. My vision is a automatically generated PDF which is printable for readers without PC.

No problem! I just thought (not tested) that HTML file format might provide a solution for your remaining issue.

@GaryGriffin
I will follow your advice with a tweak and feature request!
I will mark the thread with the flag „Solution“!
Thanks for every assistance!
@Nick-Hall , @emyoulation , @Gioto and @csam , I appreciate all your help! :clap:

Maybe just “Print content of the HTML to a file (PDF file format)”?