maybe it might help to see an example in a plugin?
Entity file:
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/classes/local/entities/attendance.php
Reportsource using that entity:
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/classes/reportbuilder/datasource/attendance.php
those 2 classes (plus the language strings used in the new files) are the only things you need to create a new custom report.
basically your entities go in your plugin under classes/local/entities and your reportbuilder datasource goes in the classes/reportbuilder/datasource/ folder in your plugin.
Entity file:
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/classes/local/entities/attendance.php
Reportsource using that entity:
https://github.com/danmarsden/moodle-mod_attendance/blob/MOODLE_401_STABLE/classes/reportbuilder/datasource/attendance.php
those 2 classes (plus the language strings used in the new files) are the only things you need to create a new custom report.
basically your entities go in your plugin under classes/local/entities and your reportbuilder datasource goes in the classes/reportbuilder/datasource/ folder in your plugin.