Desktop productivity for business analysts and programmers

CSS File for SAS EG

Reply
New Contributor
Posts: 3

CSS File for SAS EG

I have created a CSS file that is compatible with SAS EG and would like for everyone in our environment to use it for their reports. I have tested the CSS file using my install of SAS EG and it makes the formatting changes to reports. My team and I want to make this file available at the server level. I've tried making the CSS file available out on our server and putting the path of it in the Style Manager in SAS EG. That didn't work and it kept crashing my Style Manager. The option that I was given was to manually send out my CSS file and hope everyone who wants to use it makes the necessary changes to their SAS EG. Since a lot of our users do not have administrator rights to their machine, they won't be able to save the CSS file to their C drive in the Style folder under SAS EG and then make the necessary changes within SAS EG. Is there a way the I can put the file out on a server and then users will be able to link the CSS file to their SAS EG using Style Manager?

Community Manager
Posts: 2,889

Re: CSS File for SAS EG

In Style Manager, click Add... to create a new style.  Select Add new external style and give it a name, then specify a URL where you placed it on your intranet.

 

styman.png

 

You then would need to set your default style to this new style name.

 

Yes, each user would need to complete this step.

 

As an alternative, you can use PROC TEMPLATE in SAS to read in a CSS file and create a new ODS template style.  Then the steps to use are a little different. 

 

  • Each user still probably wants the CSS in the local folder: %appdata%\SAS\SharedSettings\Styles.  Everyone should be able to write to that space for their user profile.
  • Create a new style in Style Manager, but this time name it as you named it in the PROC TEMPLATE step, and check the box for "Server-only style"
  • Ensure that the ODS PATH is set to include the location of your new template in the places that it searches for style templates.  Again, each user would need this -- or else put the style template in a common place found by default, or alter the SAS session autoexec to include it.

The advantage of this approach (while it seems like more work) is that the new style can also work for PDF and RTF (and ODS EXCEL and POWERPOINT in 9.4).

 

Chris

New Contributor
Posts: 3

Re: CSS File for SAS EG

Does the version of SAS EG matter when doing these steps? I am running SAS EG 7.1 but the user is running SAS EG 5.1. I have a user who is helping me out and I told him to save the CSS file to C:\Users\<userID>\AppData\Roaming\SAS\SharedSettings\Styles and then add a new Style in the Style Manager. Then we he executes his report and attempts to change the format, it gives him the error saying Style Not found; Default style will be used instead.

 

But when I perform these steps with EG 7.1, it allows me to preview the style after I made the changes to the Style Manager and successfully changes the format of my reports.

Community Manager
Posts: 2,889

Re: CSS File for SAS EG

I think that he might be seeing the warning about the style not being found because SAS can't find the ODS template style with that name.  Even though the CSS reference is probably coming through, you still need the STYLE= value to refer to a style that SAS can find in templates...or else SAS issues the warning.


To solve, you can have him create a "shim" style with that name ("mystyle" in this example):

 

proc template;
 define style mystyle;
   parent=minimal;
 end;
run;

 

 

Ask a Question
Discussion stats
  • 3 replies
  • 357 views
  • 0 likes
  • 2 in conversation