****************************************************************************************************
* PROGRAM OVERVIEW
****************************************************************************************************
*
* PROGRAM: output_report.sas
* Created (mm/dd/yyyy): 02/24/2021
*
*--------------------------------------------------------------------------------------------------
* PURPOSE: This macro drives the calling of each macro to produce a report
*
* Program inputs:
*
*
* Program outputs:
* - qrp_report.pdf
* - qrp_report.xlsx
*
* PARAMETERS:
* - destination: ODS destination. Valid values: excel or pdf
* - font: font
* - fontsize = font size
* - footfontsize = font size for footnotes, typically set as 1 pt smaller than fontsize
* - bordersize = line thickness for top/bottom report lines
*
* Programming Notes:
*
*
*--------------------------------------------------------------------------------------------------
* CONTACT INFO:
* Sentinel Coordinating Center
* info@sentinelsystem.org
*
***************************************************************************************************;
%macro output_report(destination = , font=, fontsize=, footfontsize=, bordersize=);
%put =====> MACRO CALLED: output_report;
***************************************************************************************************;
* Set up and initialize report template
***************************************************************************************************;
/*report template*/
%report_template(outputtype = &destination., fontsize = &fontsize., font = &font.);
ods listing close;
ods select all;
ods noresults;
%if &destination. = excel %then %do;
ods excel file="&output.qrp_report.xlsx" NOGTITLE style = qrp_report_excel
options(embedded_titles="yes"
sheet_interval="proc"
gridlines="off"
embedded_footnotes= "yes"
flow="tables");
%end;
%if &destination. = pdf %then %do;
/* Prevent path from being written to log */
proc printto log=log;
run;
ods pdf file="&output.qrp_report&reportid..pdf" NOGTITLE dpi=300 pdftoc=1 style = qrp_report_pdf;
/* Resume writing to log */
proc printto log="&OUTPUT.qrp_report_log&reportid..log";
run;
%end;
ods noproctitle;
options nodate nonumber orientation=portrait;
ods escapechar="^";
title;
/* Counter for figure number */
%let figurenum=1;
/* Counter for table number */
%let tablenum=1;
/*leavebehindreport logo*/
%if &leavebehindreport. = Y %then %do;
%if %str("&logofile") ne %str("") & &destination. = pdf %then %do;
title j=L "^{style[preimage='&input./&logofile.']}" ' ';
%end;
%end;
***************************************************************************************************;
* Table of Contents
***************************************************************************************************;
%if &destination. = excel %then %do;
ods excel options(sheet_name="Table of Contents"