i think this is mostly copy pasted from https://github.com/dimagi/commcare-hq/blob/master/corehq/apps/reports/templates/reports/base_template.html#L89? should probably make a partial template that the two can share unless there are big differences that need to exist between them.