I recently began work with a new company that uses Enterprise Guide which my previous employer did not have for me to test on. I have several macros that output tables specifically formatted to look the same in all destinations (RTF, Excel, PDF, HTML, etc.), but the results viewer in Enterprise Guide isn't following the style modifications like the other destinations. EG is using ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR as the destination. Here is some example code:
ods rtf file='test.rtf';
ods escapechar='^';
proc report data=sashelp.class nowd split='~' style(header)={vjust=bottom};
columns name sex age height weight;
define name / display 'Name^{super 1}' style={cellwidth=1.5in};
define sex / display 'Test~Sex';
compute sex ;
if sex='F' then call define('name','style/merge','style={fontweight=bold}');
else call define('name','style/merge','style={leftmargin=0.12in}');
endcomp;
compute after;
line @1 '^{super 1}This Is A Test Footnote';
endcomp;
run;
ods rtf close;
When I look at the RTF file I get the following:
However when I look at the same table output in the EG results window I get the following:
I can't seem to fix the following issues:
I don't think the company focuses too much on what the results look like in the EG results window, but I'm just curious about figuring out what is going on.
What version of Enterprise Guide are you using?
What version of SAS are you using to run the SAS code?
Later versions of SAS Enterprise Guide moved away from SAS Report (ODS tagsets.sasreport13) format as the default, and instead use HTML5. This responds to style updates like you seem to be looking for. I would not recommend SAS Report unless you are directly sharing these results with other SAS applications that can read it (SAS Add-In for Microsoft Office, for example).
If your ultimate deliverable is RTF, then I suggest you enable that in your SAS Enterprise Guide preferences (Tools->Options->Results).
Did you try style asis=on or pretext=' ' ?
ods rtf file='test.rtf'; ods escapechar='^'; proc report data=sashelp.class nowd split='~' style(header)={vjust=bottom}; columns name sex age height weight; define name / display 'Name^{super 1}' style={cellwidth=1.5in}; define sex / display 'Test~Sex'; compute sex ; if sex='F' then call define('name','style/merge','style={fontweight=bold}'); else call define('name','style/merge','style={leftmargin=0.12in asis=on pretext=" "}'); endcomp; compute after; line @1 '^{super 1}This Is A Test Footnote'; endcomp; run; ods rtf close;
I'll start with an opinion: chasing a pixel-perfect layout for HTML-based results in a tool like SAS Enterprise Guide -- that's probably more effort than it's worth. Of course SAS programmers who are accustomed to producing output for journals and other research are used to employing all kinds of tricks for RTF and PDF. But HTML is so dependent on browser, user display preferences, styles in CSS, etc. -- you can spend a lot of energy and still not achieve the result you want.
That said, in EG and SAS there are multiple factors that contribute to HTML appearance:
proc template;
path sashelp.tmplmst;
list styles;
run;
You can define new styles with PROC TEMPLATE, and you can use PROC TEMPLATE to build new stylesheets that you can then add to the Style Manager in EG.
You can also edit/create a CSS file with the proper CSS classes, and use PROC TEMPLATE to read that in and create a SAS style template. You can find more doc in the ODS section of SAS documentation.
However, if you want to make style changes that everyone in a company can see/use in the same way, then you need to use PROC TEMPLATE to define and add to a central location, update the ODS template search path so it will be found when referenced, and then use EG's Style Manager to add it as an option to the selectable styles ("server-only style").
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.