Answers.Body: <p>Are you using drupal? You might get what you want with a drupal view.</p>
  
  <p>The "extended report" extension (<a href="https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport" rel="nofollow noreferrer">https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport</a>) has a case pivot report where you can filter on activity date for example. It might get you close.</p>
  
  <p>A sideways thought: You mention upcoming scheduled so I assume there is a further end use for this report, which might be achievable other ways. For example scheduled reminders or civirules might be able to give advance notice when certain conditions are met.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-16T19:52:29.577Z
Answers.Text: Using Joomla, so no view option. But Eileen's Extended Report extension looks very promising. Thank you.
Answers.UserDisplayName: Jern
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-16T20:05:12.327Z
Answers.Text: Have added another thought to the answer.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-17T08:08:53.720Z
Answers.Text: Thanks. Yes, we're using scheduled reminders as well, and civirules. In order to include case-related data in the reminders, I've added read-only custom fields to the activities, and a hook to add the case data to the activity when the activity is created. It's clunky but it sort of works. We can also use it to include case data in activity reports. But it's not a long-term solution. We don't have any way of syncing the activity case fields with the case data, for example. So I was hoping to find a better solution, at least for the reports.
Answers.UserDisplayName: Jern
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-17T08:23:39.987Z
Answers.Text: I suppose what we ideally need is some kind of back-link field in the activity, which would fetch the case data dynamically. Maybe a field which contains an API call.
Answers.UserDisplayName: Jern
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-17T15:09:29.847Z
Answers.Text: If you're comfortable with exporting to excel and cross-referencing, e.g. with VLOOKUP, it's not too hard to add case id to the Activity Detail civireport, and then you can export it and a regular case detail report and cross-ref. This is *very* lightly tested but see https://gist.github.com/demeritcowboy/6a0654160fd78ef5899698324561830d.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-18T07:38:02.533Z
Answers.Text: Thank you! And I suppose the patch could be extended in a similar manner to include a civicrm_case alias and the appropriate joins to civicrm_case, to fetch data which is only in the case table. In my case, this would still leave the issue of having the case fields available to use as tokens in scheduled reminders. So I either have to find two separate solutions, or stick with my clunky solution of using custom activity fields, because this solves both issues, and manage the syncing with an extra hook.
Answers.UserDisplayName: Jern
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-16T15:33:58.560Z
Answers.LastActivityDate: 2019-02-16T20:04:46.070Z
Answers.LastEditDate: 2019-02-16T20:04:46.070Z
Answers.UserDisplayName: Demerit
Body: <p>I would like to generate an Activities report (eg upcoming scheduled activities) which includes case data (eg case ID, case Subject, case Role contacts, case custom fields) of the case to which each listed activity relates. Is there an 'approved' way of doing this? Thanks.</p>
  
Tags: <custom-fields><civireport><civicase><activities>
Title: CiviCRM report for Case activities listing Case data
ThreadText: # CiviCRM report for Case activities listing Case data
  
  (Asked by: username_0 on 2019-02-16)
  
  I would like to generate an Activities report (eg upcoming scheduled activities) which includes case data (eg case ID, case Subject, case Role contacts, case custom fields) of the case to which each listed activity relates. Is there an 'approved' way of doing this? Thanks.
  
  **Tags:** custom-fields, civireport, civicase, activities
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-02-16. Score: 1 | Accepted answer
  
  Are you using drupal? You might get what you want with a drupal view.
  
  The "extended report" extension (<https://github.com/eileenmcnaughton/nz.co.fuzion.extendedreport>) has a case pivot report where you can filter on activity date for example. It might get you close.
  
  A sideways thought: You mention upcoming scheduled so I assume there is a further end use for this report, which might be achievable other ways. For example scheduled reminders or civirules might be able to give advance notice when certain conditions are met.
  
  > **Comments:**
  > **username_0**: Using Joomla, so no view option. But Eileen's Extended Report extension looks very promising. Thank you.  
  > **username_1**: Have added another thought to the answer.  
  > **username_0**: Thanks. Yes, we're using scheduled reminders as well, and civirules. In order to include case-related data in the reminders, I've added read-only custom fields to the activities, and a hook to add the case data to the activity when the activity is created. It's clunky but it sort of works. We can also use it to include case data in activity reports. But it's not a long-term solution. We don't have any way of syncing the activity case fields with the case data, for example. So I was hoping to find a better solution, at least for the reports.  
  > **username_0**: I suppose what we ideally need is some kind of back-link field in the activity, which would fetch the case data dynamically. Maybe a field which contains an API call.  
  > **username_1**: If you're comfortable with exporting to excel and cross-referencing, e.g. with VLOOKUP, it's not too hard to add case id to the Activity Detail civireport, and then you can export it and a regular case detail report and cross-ref. This is *very* lightly tested but see https://gist.github.com/demeritcowboy/6a0654160fd78ef5899698324561830d.  
  > **username_0**: Thank you! And I suppose the patch could be extended in a similar manner to include a civicrm_case alias and the appropriate joins to civicrm_case, to fetch data which is only in the case table. In my case, this would still leave the issue of having the case fields available to use as tokens in scheduled reminders. So I either have to find two separate solutions, or stick with my clunky solution of using custom activity fields, because this solves both issues, and manage the syncing with an extra hook.  
  
  ---
  
  