# Report on Events with or without filters

**URL:** <https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779>\
**Category:** Help\
**Created:** [October 4, 2020, 3:19am UTC](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779 "2020-10-04T03:19:20Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![les61](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@les61](https://gramps.discourse.group/u/les61)\
**Post date:** [October 6, 2020, 10:15pm UTC](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779/29 "2020-10-06T22:15:53Z")

</div>

George

I had added the “from gramps … import…” by cutting and pasting but had added it after the first lien not the 3rd line. Moved it to after the 3rd line but still no luck. Moved it to the end of that section and again still no luck.

If I restart the changes can I just do the “from gramps … import…” without the other changes and run it would it work even if it did not bring in the other changes. Just want to see if the problem is the “from gramps … import…” area

Thanks

Les

---

<div class="post-metadata">

**Author:** ![les61](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@les61](https://gramps.discourse.group/u/les61)\
**Post date:** [October 6, 2020, 10:42pm UTC](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779/30 "2020-10-06T22:42:33Z")

</div>

George

I answered my own question by making the “from gramps … import…” changes and it worked but the resulting database was the same as from the original SQLite export. I them added one of the changes as follows:

_Changed this line in export\_event\_ref():_

_# role[1],_  
_str(EventRoleType(role)),_

so it now looks like

_def export\_event\_ref(db, from\_type, from\_handle, event\_ref):_  
_(private, note\_list, attribute\_list, ref, role) = event\_ref_  
_handle = create\_id()_  
_db.query("""insert INTO event\_ref (_  
_handle,_  
_ref,_  
_role0,_  
_role1,_  
_private) VALUES (?,?,?,?,?);""",_  
_handle,_  
_ref,_  
_role[0],_  
_**# role[1],**_  
_**str(EventRoleType(role)),**_  
_private)_  
_export\_list(db, “event\_ref”, handle, “note”, note\_list)_  
_export\_attribute\_list(db, “event\_ref”, handle, attribute\_list)_  
_# finally, link this to parent_  
_export\_link(db, from\_type, from\_handle, “event\_ref”, handle)_

but still no changes, still 28 tables in the export where as I thought it should have added a table “EventRoleType”.

So just to clarify.

With the changes I have made I should get the extra table(s) specifically the EventRoleType table?

Thanks again

Les

---

<div class="post-metadata">

**Author:** ![les61](https://avatars.discourse-cdn.com/v4/letter/l/e36b37/32.png) [@les61](https://gramps.discourse.group/u/les61)\
**Post date:** [October 7, 2020, 12:32am UTC](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779/31 "2020-10-07T00:32:23Z")

</div>

George

SUCCESS! Through trial and error I have found that if I do not make the changes for Markup Notes that it all works fine. I now have a report in SQLite that shows which events I have as a Marriage but do not have the individuals as either Bride or Groom.

Many thanks

---

<div class="post-metadata">

**Author:** ![GeorgeWilmes](https://avatars.discourse-cdn.com/v4/letter/g/c57346/32.png) [@GeorgeWilmes](https://gramps.discourse.group/u/GeorgeWilmes)\
**Post date:** [October 7, 2020, 12:38am UTC](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779/32 "2020-10-07T00:38:19Z")

</div>

No, there won’t be any new tables, rather the description columns in the existing tables will now be populated.

For example, for the event role type, you will see in the event\_ref table that column role0 has an integer value and column role1 has the corresponding description.

There are a few other integer values for which you’ll need to create your own descriptions, if you want them. I created a lookup table like this:

DROP TABLE constants;  
CREATE TABLE constants (  
table\_name CHARACTER(25),  
column\_name CHARACTER(25),  
code INTEGER,  
value TEXT);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘quality’, 0, ‘Regular’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘quality’, 1, ‘Estimated’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘quality’, 2, ‘Calculated’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 0, ‘Regular’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 1, ‘Before’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 2, ‘After’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 3, ‘About’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 4, ‘Range’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 5, ‘Span’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘modifier’, 6, ‘Text only’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘newyear’, 0, ‘January 1’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘newyear’, 1, ‘March 1’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘newyear’, 2, ‘March 25’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘newyear’, 3, ‘September 1’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 0, ‘Gregorian’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 1, ‘Julian’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 2, ‘Hebrew’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 3, ‘French’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 4, ‘Persian’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 5, ‘Islamic’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘date’, ‘calendar’, 6, ‘Swedish’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘citation’, ‘confidence’, 0, ‘Very low’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘citation’, ‘confidence’, 1, ‘Low’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘citation’, ‘confidence’, 2, ‘Normal’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘citation’, ‘confidence’, 3, ‘High’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘citation’, ‘confidence’, 4, ‘Very high’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘display\_as’, 0, ‘Default’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘display\_as’, 1, ‘Surname, Given Suffix’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘display\_as’, 2, ‘Given Surname Suffix’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘display\_as’, 4, ‘Given’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘display\_as’, 5, ‘Main Surnames, Given Patronymic Suffix Prefix’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘sort\_as’, 0, ‘Default’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘sort\_as’, 1, ‘Surname, Given Suffix’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘sort\_as’, 2, ‘Given Surname Suffix’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘sort\_as’, 4, ‘Given’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘name’, ‘sort\_as’, 5, ‘Main Surnames, Given Patronymic Suffix Prefix’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘person’, ‘gender’, 0, ‘Female’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘person’, ‘gender’, 1, ‘Male’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘person’, ‘gender’, 2, ‘Unknown’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘note’, ‘format’, 0, ‘Unformatted’);  
INSERT INTO constants (table\_name, column\_name, code, value) VALUES (‘note’, ‘format’, 1, ‘Preformatted’);

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/gramps/original/1X/2ac1e712b7adf612e31ca08a55419f4cf37c0158.png) [@system](https://gramps.discourse.group/u/system)\
**Post date:** [November 6, 2020, 12:38am UTC](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779/33 "2020-11-06T00:38:24Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

[Previous page](https://gramps.discourse.group/t/report-on-events-with-or-without-filters/779.md?page=1)
