The SAS Output Delivery System and reporting techniques

_odsStyle=Journal3, how to change ods style

Not applicable
Posts: 0

_odsStyle=Journal3, how to change ods style

I use SAS Management Console to create prompts and SAS Web to produce a report which consist of :

ods text,
proc reports
and proc tabulate.

To display the report I use _odsStyle=Journal3 and _odsDest=pdf. Is it possible to create my own template/style if I want to change fonts / titles/ layout of this pdf?
Posts: 9,371

Re: _odsStyle=Journal3, how to change ods style

Posted in reply to deleted_user
I don't know exactly what you mean by "SAS Web" -- you could mean SAS Web Report Studio, SAS/IntrNet, SAS Information Delivery Portal, the Stored Process Web Application or a custom BI Web Service that you wrote yourself. Additionally you could be using one of the SAS client applications, such as Enterprise Guide or the SAS Add-in for Microsoft Office. I suspect, since you are generating PDF output that you are either using SAS Enterprise Guide, SAS/IntrNet, SAS Information Delivery Portal, the SPWA or a custom BI Web Service.

The short answer is that it is possible to alter the style template that you use with a stored process -- if you understand how your client application handles style information. For example SAS Enterprise Guide uses a CSS (Cascading Stylesheet) version of SAS style templates, so for Enterprise Guide, you might want to use the Style Wizard to draft your new style. SAS Web Report Studio, on the other hand, uses style information that is embedded in the XML instructions for the middle tier "plumbing" that runs Web Report Studio.

The hardest thing to figure out usually is 1) what kind of style is used by your client application and 2) where on the server you need to store the changed style template or CSS file (unless you have a client application that would use a "temporary" template that is created every time the stored process runs). And then the next hardest thing is learning PROC TEMPLATE to change the style elements and style attributes that you want to change. Learning PROC TEMPLATE can be a challenge when you're just working in Base SAS -- since some client applications use CSS or style templates, that adds another layer of complexity when you talk about styles and the BI Platform.

For PROC REPORT and PROC TABULATE, you can use style=overrides in the procedure syntax to alter the style of various report elements (such as fonts and colors). To change the titles of the report, you can use various syntax in the TITLE statement itself, such as:
title f='Courier New' h=14pt c=purple 'My Purple Title';

To change the style of ODS TEXT generated lines you can either use ODS ESCAPECHAR functionality or you can change a style template. In the code below, everything is changed in STYLE= overrides. All the fonts are changed to Courier New and the ODS TEXT is changed to Courier New and the header colors are changed -- all without a change to the style template. This might be an approach to try first before you go down the template road.

If you do want to change the ODS style template used for your output, then you will have to
1) learn how to create/change style templates with PROC TEMPLATE
2) learn how to use the ODS PATH statement to control where style templates are written
3) create and test your new template in a local environment and make sure the template works correctly in Base SAS
4) when the template works correctly, create your new template in a location that is accessible to both the Workspace server and Stored Process server (and/or make a CSS version of your new template if you are using a client application that uses CSS)
5) test the template (or CSS file) in all the client applications where the new template could be used.

As I said, you might try using a program similar to the one below (but turned into a stored process) before you go down the template road.

options orientation=portrait topmargin=.5in bottommargin=.5in nodate nonumber;
title; footnote;
ods pdf file='c:\temp\change_title_font.pdf' notoc startpage=no style=journal3;
ods escapechar='^';

proc report nowd
style(header)={background=pink font_face='Courier New'}
style(column)={font_face='Courier New'};
column region subsidiary product sales inventory returns;
title f='Courier New' h=14pt c=purple 'My Purple Title';

ods text="^{style[just=c color=purple font_size=14pt font_weight=bold font_face='Courier New']Now For Something Completely Different}";
proc report data=sashelp.prdsale(obs=5) nowd
style(header)={background=yellow font_face='Courier New'}
style(column)={font_face='Courier New'};

ods _all_ close;
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation