BookmarkSubscribeRSS Feed
mathias
Quartz | Level 8

Hello,

In stored process, the titles of my graphics do not have any style.

I made a proc template to define my own style:

ODS PATH(PREPEND) work.templat(update);

proc template;

  define style wivisp_SASstyle;

  parent = Styles.Normal;

  (...)

  class SystemTitle /

    color=black

    fontweight=bold

    fontsize=16pt;

(...)

end;

ods html style=wivisp_SASstyle; *no file statement or it will not work in stored process;

This is well applied in the enterprise guide graphics.

But for stored precesses, titles are simple html text:

<td class="c SystemTitle" style=" padding: 0px;">Monthly distribution of Enterovirus           </td>

How to modify this title appearance?

10 REPLIES 10
macroCharlie
Calcite | Level 5

Have you tried putting this code at the top of your stored process?

     %global _ODSDEST _ODSSTYLE _ODSOPTIONS;

     %let _ODSDEST = PDF;

     %let _ODSOPTIONS =;

     %let _ODSSTYLE = wivisp_SASstyle;

_ODSDEST can be pdf, html, rtf, etc. and defaults to html;

It seems when you publish a stored process it has a lot of default _ODSOPTIONS which from what I can tell aren't needed;

Cynthia_sas
SAS Super FREQ


Hi:

  Usually, in a stored process, you use the special %STPBEGIN and %STPEND macro calls around your stored process code. This means that you also use _ODSSTYLE and _GOPTIONS, as described here:

http://support.sas.com/documentation/cdl/en/stpug/62758/HTML/default/viewer.htm#p184mqqbi9w6qjn1q061...

The "c SystemTitle" that you see shows that ODS HTML tried to set a CLASS attribute in the HTML for the title. If you do not SEE the impact of the style changes, that means either you are running the stored process in a location that does not respect the CLASS attribute in HTML for setting style or 2) that your stored process is creating incorrect HTML. Since ODS HTML creates an in-line <STYLE> section in the HTML, you would have to look in the <HEAD> section of the HTML page for the .SystemTitle class selector to see whether your style changes got carried over into the in-line style in the HTML stream.

  Another factor is that when you use HTML and graphics procedures, you have to decide how you will use the HTML option GTITLE or NOGTITLE: with GTITLE in effect, the graphics software is in control of the title; with NOGTITLE in effect, ODS is in control of the title. Without knowing more about your stored process, and how this option is being set, it's hard to figure out whether this is contributing or not.

   If I run this code:

ods path work.tmp(update) sasuser.templat(update)
         sashelp.tmplmst(read);
              
proc template;
  define style wivisp_SASstyle;
  parent = Styles.Normal;
  class SystemTitle /
    color=purple
    fontweight=bold
    fontsize=16pt;
end;
run;
  
ods html path='c:\temp' (url=none) style=wivisp_SASStyle
         file='testtitle.html' nogtitle;

title 'My Title';

proc gchart data=sashelp.class;
  vbar age / discrete;
run;
quit;

ods html close;

  Then, as you can see in the screenshot, the string "My Title" is purple in the HTML file. If I look in the HTML source, I only see this:

<td class="c systemtitle">My Title</td>

but if I look for the .systemtitle class selector in the in-line style section, I see that the color has been changed to #800080, which is hexadecimal value for purple and the font size is 16pt:

.systemtitle

{

  color: #800080;

  font-family: Arial, 'Albany AMT', sans-serif;

  font-size: 16pt;

  font-weight: bold;

  padding: 0px;

}

Since you say that the changes appear to work in EG, that might also mean you are trying to run your stored process in a client application, such as PowerPoint or Web Report Studio, which may not use the style template information.

There are so many possible things that could be happening with your stored process that it might be better for you to work with Tech Support on the resolution of this issue. They can look at ALL your code and get information about the client application where this is not working and they can look at ALL your option settings to help you figure out a solution.

cynthia


Purple_title.png
mathias
Quartz | Level 8

Actually, there is no inline css in the page.

CSS is defined like this :

<link rel="stylesheet" type="text/css" href="https://xxx.xxx.xxx/SASStoredProcess/WIVISP_SASSTYLE">

 

When I click on the link to view css, this message appears :

 

Etat HTTP 404 - /SASStoredProcess/WIVISP_SASSTYLE


type Rapport d'état

message /SASStoredProcess/WIVISP_SASSTYLE

description La ressource demandée (/SASStoredProcess/WIVISP_SASSTYLE) n'est pas disponible.


JBossWeb/2.0.0.GA

 

[ Translation : The ressource (/SASStoredProcess/WIVISP_SASSTYLE) is not available ]

Does this means that wivisp_sasstyle.css was not created or that it is not accessible ?

Cynthia_sas
SAS Super FREQ

Hi:

  That seems to be the implication. That's why I would recommend working with Tech Support. Your message implies to me that ODS HTML is not the destination being used for the creation of your output or, it could also imply that other options are being set behind the scenes (like _ODSSTYLESHEET or CSSSTYLE or STYLESHEET=). Either way, Tech Support are the ones best qualified to help you.

cynthia

macroCharlie
Calcite | Level 5

In looking at the log of an sp, these some of these options are set automatically unless you reset them:

_ARCHIVE_PATH=TEMPFILE

_CLIENT=SAS Enterprise Guide; CLR 4.0.30319.269; Microsoft Windows NT 6.1.7600.0

_CLIENTNAME=SAS Enterprise Guide

_ENCODING=UTF8

_GOPT_DEVICE=ACTIVEX

_METAFOLDER=/Shared Data/YourFolder/

_METAPERSON=YourLogin

_METAUSER=YourEmail

_ODSDEST=tagsets.sasreport13

_ODSOPTIONS=options(rolap="on") ATTRIBUTES=("CODEBASE"=http://www2.sas.com/codebase/graph/v93/sasgraph.exe#version=9,3)

_ODSSTYLE=HtmlBlue

_ODSSTYLESHEET=(URL=file:///C:/Program%20Files/SASHome/x86/SASEnterpriseGuide/5.1/Styles/HtmlBlue.css)

_PROGRAM=/Shared Data/YourFolder/YourProgram

_REPLAY="&_URL?_sessionid=00000000-0000-0000-0000-000000000000&_program=replay&_entry=&_TMPCAT.."

_RESULT=PACKAGE_TO_ARCHIVE

_SECUREUSERNAME=(Process)

_TMPCAT=APSWORK.TCAT0000

_USERNAME=(Process)

Cynthia_sas
SAS Super FREQ

Hi:

  Also, the fact that his <LINK> is using an HTTPS:// url, instead of a FILE:// or regular HTTP:// implies to me that there is a real possibility that other changes have been made behind the scenes. That, coupled with the odd invocation of the stored process (without using
%STPBEGIN/%STPEND) and not knowing which client application, other than EG, is involved (PPT? WRS? Portal?) also makes it hard to figure out what's going on.

cynthia

macroCharlie
Calcite | Level 5

EG 5.1 automatically puts in %STPBEGIN and %STPEND unless you uncheck them.

Cynthia_sas
SAS Super FREQ

Yes, that's always been true of EG and SPs, that the %STPBEGIN is added when you create a SP. And because he has ODS HTML as a separate statement in the SP, there could be conflicts. Not all client applications accept HTML results from a stored process. So, if he used EG or the Portal or the Stored Process Web App, he might be OK with that ODS HTML statement as an appropriate "extra" statement to have in his stored process (as he showed). But, if he did not turn off the %STPBEGIN/%STPEND -AND- his SP has the ODS HTML statement -AND- he was using WRS or PowerPoint as the client application (or using any AMO application without changing the result type to HTML), the chances are good that he has sent conflicting information to the server for that SP. For example, WRS uses the SASReport destination, not ODS HTML -- so his ODS HTML specification for STYLE would be NOT be used by SASReport and WRS and who knows what his ODS HTML STYLE= specification would do? It's unpredicable -- which is why I think the OP needs to work with Tech Support. Too many possible factors at play without enough information.

cynthia

mathias
Quartz | Level 8

thanks

I feel I'm not far now (I'll contact support as you suggested if necessary)

I suppressed every conflicts I could find

A custom style seems to be applied if and only if

I write "%stpbegin" ...  "%stpend"

AND

"%let _ODSSTYLE = wivisp_SASstyle;" in the code before %stpbegin

So my question is:

Where is that style (wivisp_SASstyle) which the stored process is obviously using ?

Is this defined by the "%stpbegin" statement ?

I'm convinced it is not in "Common.templat"

(I stored my final template there with "ODS PATH(PREPEND) common.templat(update);"

If I'am right, how do I tell the stored process to read the template in Common.templat ?

Many thanks for your replies, very helpfull so far

Cynthia_sas
SAS Super FREQ

Hi:

  if you used ODS PATH (PREPEND) to WRITE your template to the COMMON.TEMPLAT item store and if your libref COMMON is in a location known to the Stored Process Server and Workspace server (an important IF -- but the name COMMON implies that your SAS Admin has done something nice for you). And, if (another important IF) the servers all have an ODS PATH that points to COMMON, then the act of putting your override -before- %STPBEGIN is enough to override the default style that is set in    
%STPBEGIN. For example, in SAS 9.3, the default style for PDF is STYLES.PRINTER -- if you used

%let _odsstyle=journal;

%let _odsdest=pdf;

%stpbegin;

in your stored process, then SAS and ODS would know that you meant to override the default destination to PDF; and the style for PDF is usually STYLES.PRINTER, except you also want to override that style with STYLES.JOURNAL. Now, STYLES.JOURNAL is a SAS-supplied template. It will be found in SASHELP.TMPLMST item store -- so there is no need for the ODS PATH to change in order to use the JOURNAL style, because the SASHELP item stores is ALWAYS known to SAS.

But, if you have a user defined style (such as yours) and IF you have put it in the right location (which it seems you have) and IF the servers all have a pointer to that location (I can't answer this question for you), then your style in the %LET will override whatever style would normally be set by default in %STPBEGIN macro call.

You could add code to your stored process to reveal the current PATH in the log:

ODS PATH SHOW;

and then you'd know for sure whether COMMON was being used. As I said before, this method of specifying a style for a stored process (which you showed in your original post)

ods html style=wivisp_SASstyle;


is highly unusual and would not work if you had something like this (especially where the %STPBEGIN was added by EG BEFORE the ODS HTML statement):

%stpbegin;

ods html style=wivisp_SASstyle;

In the above scenario, %STPBEGIN would set the style and once set by %STPBEGIN, any attempt to change it is ignored by the destination for a stored process. The reserved macro variables, like _ODSSTYLE are the preferred way to modify default settings and those reserved macro variables are outlined in the link I posted.

So, this is the preferred method:

%let _odsstyle= wivisp_SASstyle;

%stpbegin;

but SAS and ODS will look through ALL the template stores in the ODS PATH search list until they find the style you've listed. If they find the style, they use the style. If they don't find the style, then they use the default for the destination. The only gotcha is that a client application like Web Report Studio might still NOT use your style because styles for WRS are stored in a special configuration file on the web server level or tier.

I'd recommend that you have your SAS Admin open a track with Tech Support or that you open a track with Tech Support. If changes to the configuration files need to be made so the style is available to everyone, your Admin person may need to be the one to change the files.

cynthia

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1351 views
  • 6 likes
  • 3 in conversation