The relative path from the Gramps application subdirectory of the Program Files folder is:
That source can be found here on GitHub (The GitHub code is a good reference tool for discussing the module. Their interface identifies original code sections by line number… which simplifies pointing out where to find each coding change.)
When modifying a built-in report, it is generally better to fork it… to create an add-on of a similar (but still unique) name. This saves having to battle with Windows over whether you have admin rights each time you want to change the file. (And, when you create a useful modification, you can share your fork on GitHub for others… which raises the report’s visibility to others who might continue to improve it.)
The wiki page on forking a report (“Adapt a built-in Report”) needs a lot of correction and expanding. (I was out of my depth! Any help from a programmer in making this document ACCURATE would be appreciated.)
The report writing tutorial describes the creating the .gpr.py registration file and general coding of reports. (See the See Also section of that wiki page for reference pages on the report API, output format options & data model.)
There isn’t a Report Snippet showing any example of sorting.
The sorting options already in the Complete Individual Report code are only about the Event data inside each individual’s report: whether to force events to sort in chronological order.