Perhaps there will be enough ReportOutput() function?
This function returns output format, e.g. 'HTML', 'PDF' etc.
This function returns output format, e.g. 'HTML', 'PDF' etc.