The stock Activity Details Report (Administer - CiviReport - Create New Report) can do this if you adjust the filters tab to include case activities and whatever other criteria you'd like.
Or take a look at the alternate civicase extension: https://github.com/civicrm/org.civicrm.civicase. You might prefer how it works. Although I'm not sure how pretty it ...
You can use the data processor extension for creating views/reports in CiviCRM.
You can find documentation on how to install extension here
There is not much documentation (yet) but there is an example documentation on how to create a search/report: https://lab.civicrm.org/extensions/dataprocessor/blob/master/docs/how_to_create_search.md
It is little difficult to provide sql for contact export as it is has many tables joins. The basic query to fetch all primary details is pasted below. The output may not be same as what you get in exported file because some of the options are converted from value to label using php and also the query is not joined with the custom data table as the table name ...
At administer - system settings - directories, there's one called custom php path that contains a folder path. Go look in that path in the filesystem and you probably have a customized version of CRM/Core/BAO/UFGroup.php. It will need to be updated with some recent changes that were made to the real CRM/Core/BAO/UFGroup.php, in particular the addition of the ...
From the backtrace, it looks like the error is due to the participantlistemaildisplay (https://github.com/voiply/com.servnettech.participantlistemaildisplay) extension enabled on your site.
To fix -
Try disabling this ext from civicrm/admin/extensions?reset=1.
Create an issue on the extension repo - https://github.com/voiply/com.servnettech....
This is fixed in 5.21. If you want to apply the patch now it's a small patch:
In fact for a quick temporary fix all you need to do is change that line 58 from
$part = idn_to_ascii($part, 0, INTL_IDNA_VARIANT_UTS46);
$part = idn_to_ascii($part);
More info: https://lab.civicrm.org/dev/core/...