Exploring, modeling, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

stored process and alternate style question

Accepted Solution Solved
Reply
New Contributor
Posts: 4
Accepted Solution

stored process and alternate style question

Hi,

I'm using SAS VA Viewer 7.3.

I'm working with a basic stored process which shows one sentence with the current year and the passed year thanks to macro-variables in the SAS code.

 

My problem is that I've tried everything to put the color of the background in white. But nothing works! It stills in grey.

 

[...]
PROC TEMPLATE;
  DEFINE STYLE styles.Myyears;
    PARENT=styles.minimal;
    STYLE Body from Body /
      TOPMARGIN = 0px
      BOTTOMMARGIN = 0px
      RIGHTMARGIN = 0px
      LEFTMARGIN = 0px
      BACKGROUND=cxFFFFFF
      BACKGROUNDCOLOR=cxFFFFFF
      BORDERWIDTH=0
      BORDERCOLOR=cxFFFFFF
      BORDERTOPSTYLE=solid
      BORDERTOPCOLOR=cxFFFFFF
      BORDERTOPWIDTH=0
      BORDERLEFTSTYLE=solid
      BORDERLEFTCOLOR=cxFFFFFF
      BORDERLEFTWIDTH=0
      BORDERRIGHTSTYLE=solid
      BORDERRIGHTCOLOR=cxFFFFFF
      BORDERRIGHTWIDTH=0;
  END;
RUN;

ODS ESCAPECHAR='^';
ODS LISTING CLOSE;
ODS PATH r_perso.tmplmst(update) sasuser.tmplmst(read) sashelp.tmplmst(read);
ODS HTML style=styles.Myyears OPTIONS(PAGEBREAK="no");
PROC ODSTEXT;
  P "My Years : ^{style[FONT_WEIGHT=BOLD]N = &YearA.} and ^{style[FONT_WEIGHT=BOLD]N-1 = &YearB.}" / style=[JUST=left FONT_SIZE=9PT FONT_FACE='Arial' COLOR=#000000 BACKGROUNDCOLOR=#FFFFFF];
RUN;
ODS HTML CLOSE;
ODS LISTING;

[...]

 

Please, see the result in attachment.

 

I would be very grateful for any advices to put the whole background in white.

 

Thanks for your help,

 

 

SamQ


Stored process background color.png

Accepted Solutions
Solution
2 weeks ago
New Contributor
Posts: 4

Re: stored process and alternate style question

Hi,

 

I've found the solution, thanks to a colleague.

 

Checking the html code resulting to the execution of the stored process via a shell command on Unix, we realized that the problem came from the stored process macros %STPBEGIN and %STPEND.

 

Indeed, they have some default options which affect the ODS output, in my case : the background color of the body's ODS output.

 

They are many options we can settle (cf. http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpmacro.html).

 

So, I've created a style with the desired attributes, a white background color among others, and I've modified the macro _ODSSTYLE in order to be equal to my new style :

 

PROC TEMPLATE;
  DEFINE STYLE styles.Myyears;
    PARENT=styles.minimal;
    STYLE Body from Body /
      TOPMARGIN = 0px
      BOTTOMMARGIN = 0px
      RIGHTMARGIN = 0px
      LEFTMARGIN = 0px
      BACKGROUND=cxFFFFFF
      BORDERTOPWIDTH=0
      BORDERCOLOR=cxFFFFFF;
  END;
RUN;
%let _ODSSTYLE=styles.Myyears;
%STPBEGIN;

[...]

%STPEND;

 

 

You can see the result below.

 Stored process white background color.png

 

Thanks for your help,

 

 

SamQ

 

View solution in original post


All Replies
Frequent Contributor
Posts: 123

Re: stored process and alternate style question

 

Looks like your background color is white.  I think your stored process is in a container and SAS VA is controlling the page color.

 

Does the rest of your SAS VA report use a gray background?

 

I've read some different posts that talk about the stored process server not honoring templates.

Here's one: https://communities.sas.com/t5/SAS-Stored-Processes/Using-custom-style-in-stored-process/td-p/4979


Tricia Aanderud
Zencos Consulting
Twitter: @taanderud - Follow me!

New Contributor
Posts: 4

Re: stored process and alternate style question

Hi Tricia,

 

Thank you for helping me.

 

As you can see on the picture in my last attachment, there is on line (this where the years are written) which is really in white thanks to the SAS code in bold :

      P "My Years : ^{style[FONT_WEIGHT=BOLD]N = &YearA.} and ^{style[FONT_WEIGHT=BOLD]N-1 = &YearB.}" / style=[JUST=left

      FONT_SIZE=9PT FONT_FACE='Arial' COLOR=#000000 BACKGROUNDCOLOR=#FFFFFF];

The rest of the background of the stored process container is in a kind of grey.

 

The problem is that this stored process container is between two text containers which have really white backgrounds. I mean that the difference of backgrounds is blatant.

 

According to VA, the style of my background's container must be white. If you see my tests in attachment (cf. attachment : "Stored process styles.png" / ['Arrière-plan'=Background, yes I'm French]), you'll see that VA-style isn't in control of the stored process background color.

 

I therefore conclude that the background color of my stored process container must be changed by the SAS code.

 

Can you see something wrong in the SAS code that I've written in the pasted post?

Do you have an example which is working?

 

Thanks for your help,

 

 

SamQ


Stored process styles.png
Solution
2 weeks ago
New Contributor
Posts: 4

Re: stored process and alternate style question

Hi,

 

I've found the solution, thanks to a colleague.

 

Checking the html code resulting to the execution of the stored process via a shell command on Unix, we realized that the problem came from the stored process macros %STPBEGIN and %STPEND.

 

Indeed, they have some default options which affect the ODS output, in my case : the background color of the body's ODS output.

 

They are many options we can settle (cf. http://support.sas.com/rnd/itech/doc9/dev_guide/stprocess/stpmacro.html).

 

So, I've created a style with the desired attributes, a white background color among others, and I've modified the macro _ODSSTYLE in order to be equal to my new style :

 

PROC TEMPLATE;
  DEFINE STYLE styles.Myyears;
    PARENT=styles.minimal;
    STYLE Body from Body /
      TOPMARGIN = 0px
      BOTTOMMARGIN = 0px
      RIGHTMARGIN = 0px
      LEFTMARGIN = 0px
      BACKGROUND=cxFFFFFF
      BORDERTOPWIDTH=0
      BORDERCOLOR=cxFFFFFF;
  END;
RUN;
%let _ODSSTYLE=styles.Myyears;
%STPBEGIN;

[...]

%STPEND;

 

 

You can see the result below.

 Stored process white background color.png

 

Thanks for your help,

 

 

SamQ

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 205 views
  • 0 likes
  • 2 in conversation