There are a couple of ways to do this:
- When creating an activity, add the Organization as a related contact.
- Create an extension to automate adding the Organization (see below).
- Create a custom report (not recommended).
As extensions go, it's pretty easy to write:
- use the
hook_civicrm_pre to hook created activities.
- Use an API call to look up the contact. Is the
contact_type equal to
Individual? Is the
employer_id not null?
- If so, add the employer as a related contact.
You'll have to consider edge cases: What happens if someone leaves an organization - does their attendance still count? If someone joins an organization after the activity, does that count? A custom report limits your ability to handle edge cases any way other than a "default" way, which is why it's not usually recommended.