2
votes

Here is how I build reports for SAS EnterpriseGRC:

  • I write sas base or macro code to collect and process data using procs and data steps.
  • Then I use file _webout; in data steps and use put statements to generate html
  • Then I register this code as a stored process and define filters which I am already handling in the code.
  • And then I navigate to Reports tab in EGRC and wala I have a report

For example my code would look like:

proc sql noprint;
CREATE TABLE work.risks AS
SELECT *
FROM opdetail.risk_L;
quit;

data _null_;
 file _webout;
 put '<html>';
 put '<body>';
 put '<table>';
 put '<tr><td>Risk ID</td><td>Risk RK</td></tr>'
run;

data _null_;
set work.risks;
 put '<tr>';
 put '<td>'; put risk_id;'</td>'
 put '<td>'; put risk_rk;'</td>'
 put '</tr>';
run;

data _null_;
 put '</table>'; 
 put '</body>'; 
 put '</html>';
run;

Now this is a very simplistic approach but a very effective one since I can theoretically represent my data in any complicated form like a correlation heat etc, as much as HTML allows

Now this technique has only one problem. Clients have a problem printing this report from within EGRC. The code I have written produces a stream output so I cant use this STP in a SAS Web Report Studio report where printing options are available. How can I solve my printing problem in the least complicated way?

p.s I know can build Informationmaps and build reports like they are supposed to but sometimes clients request demands a format of report which SAS Web Report Studio can not handle.

I could put this Print This Page in the HTML, but that puts date and page title on the top of printing page which is out of my control.

2
What is EGRC? Something version of enterprise guide?Quentin
EGRC is Governance, Risk, and Compliance, a SAS product.Joe
EGRC is short for Enterprise GRCMoon

2 Answers

0
votes

Well the least complicated way was to put a javascript print function through HTML inside the report. Though if someone IS still looking for a proper solution than ODS is the answer

0
votes

Well the simplest way to print your _stream'd html report is via your trusty web browser!

Simply navigate to www.YOURSASMIDTER/SASStoredProcess and select "List Available Stored Processes and Reports". When you find your STP, right click and open in a new tab.

You now have your html report, and the URL which can be shared with end customers - who can apply your registered filters, and print your report in their browser of choice.

Of course this is not a the recommended way to build web based reports with SAS. Your SAS code will get overcomplicated by many / complex put statements (mixing SAS code with html/css/javascript). You will also struggle to apply the thousands of excellent libraries that can jazz up your report (such as highcharts, handsontable, d3).

If you are happy to deliver your reports purely from the browser (instead of EGRC) then a suggested / more scaleable approach is to use the open source SASjs adapter. More info at https://sasjs.io