Description:
A C# console (needs no human intervention) application to do the following:
1. Order three reports from the Canvas LMS via Restful API. Wait for them to generate.
2. Download the three reports as CSV files.
3. Connect to the CSV as if it were a three-table database, and run a query to generate a single data-table for the final report:
select distinct table1.canvas_course_id, table1.short_name, table1.long_name, table1.term_id
from (SELECT provisioning.canvas_course_id, provisioning.short_name, provisioning.long_name, provisioning.term_id, unused.[short name] FROM [provisioning.csv] as provisioning LEFT JOIN [unused.csv] as unused on unused.[short name] = provisioning.short_name where unused.[short name] is null) AS table1,
(SELECT provisioning.canvas_course_id, provisioning.short_name, provisioning.long_name, provisioning.term_id, unpub.[short name] FROM [provisioning.csv] as provisioning LEFT JOIN [unpublished.csv] as unpub on unpub.[short name] = provisioning.short_name where unpub.[short name] is null) AS table2
where table1.short_name = table2.short_name order by table1.short_name;
The query is left-joined, to capture rows in table 1 (provisioning.csv) that do NOT have corresponding rows in the other two tables (unpublished.csv, unused.csv)
4. Connect the above datatable to a CrystalReports .rpt object to generate a human-readable report in PDF format
5. Upload the PDF to a course in the LMS made to hold these weekly reports. The upload is to an AWS server, using the Amazon API.
6. Delete the csv and pdf files.
The source code is visible
here (permission may be required). View an
instance of this report (publicly visible)
The compiled application will run from any windows machine; I'm running it weekly via the Win7 Task Scheduler.