BookmarkSubscribeRSS Feed
wcp_fnfg
Obsidian | Level 7

Test code below.  I want the three rows of title text to have a double border box around them.  Not sure if this is a job for ods options or a style template.

Kinda like this:

-------------------

|     Title1     |

|     Title2     |

|     Title3     |

--------------------

ods _all_ close;

ods tagsets.excelxp file='C:\test.xml'

    style=normal

    options(embedded_titles='yes');

   

title1 'First Row';

title2 'Second Row';

title3 'Third Row';

proc print data = sashelp.class(obs=3);

run;

ods _all_ close;

title; footnote;

6 REPLIES 6
Cynthia_sas
SAS Super FREQ

Hi:

  I don't usually have a lot of luck with TAGSETS.EXCELXP and borders. Generally, if this was HTML, I would say that you'd need to use a style template and change the TitlesandFooters style element. But this will put a border around each title statement separately. Unless you build 1 Title statement with multiple "newline" commands. But there is no guarantee that the same code will work the same in TAGSETS.EXCELXP, so if it doesn't work the way you want in that destination, you might need to open a track with Tech Support.

Cynthia

ods _all_ close;

  

ods path work.tmp(update) sasuser.templat(update) sashelp.tmplmst(read);

  

proc template;

  define style styles.mytitle;

  parent=styles.sasweb;

  style TitlesAndFooters from Container /

        borderwidth=2px

        frame=box

        bordercolor=black

        backgroundcolor = colors('systitlebg')                             

        color = colors('systitlefg');

  end;

run;

ods escapechar='~';

ods html file='c:\temp\test_title_border.html' style=mytitle;

    

title1 'First Row ~{newline 1} Second Row ~{newline 1} Third Row';

proc print data = sashelp.class(obs=3);

run;

ods _all_ close;

title; footnote;

wcp_fnfg
Obsidian | Level 7

Thanks, Cynthia.

Yeah, I tried the new lines, but I couldn't get it to work 100%.  I could get the titlecontainer (or something like that) statement to put a box around every title, but when I'm doing title1, title2, title3, it would put a box around each title, rather than the whole thing.

Cynthia_sas
SAS Super FREQ

Hi:

  Well this is my output with ODS HTML and the above code.

title_border_html.png

But, it might or might not work in TAGSETS. EXCELXP.

cynthia

wcp_fnfg
Obsidian | Level 7

This is very close, but there's an extra box (over obs)! :smileyangry:

title box.png

proc template;

  define style mytitle;

  parent=styles.sasweb;

  style TitlesAndFooters from Container /

        borderwidth=2px

        frame=box

        bordercolor=black

        backgroundcolor = colors('systitlebg')                            

        color = colors('systitlefg');

  end;

run;

ods escapechar='~';

ods tagsets.excelxp

file= "\\FNGWSASFSPR01\SASData\PATTON\Test\test.xml"

options (embedded_titles='yes') style=mytitle;

title1 'First Row ~{newline 1} Second Row ~{newline 1} Third Row';

proc print data = sashelp.class(obs=3);

run;

ods _all_ close;

title; footnote;

Cynthia_sas
SAS Super FREQ

Hi:

  If  I gave out T-shirts, I would give you one of my "It depends on the destination" T-shirts. You've earned it!

  You might work with Tech Support to see if they have a workaround or suggestion. But this is why I say that border control in the Spreadsheet Markup Language XML that Microsoft introduced in 2003 is sort of dicey.

cynthia

wcp_fnfg
Obsidian | Level 7

I take an adult medium!

I wonder if this is something that would be fixed by the ods excel output, but we don't have it here yet and SAS can't give me a tagset to emulate it for 9.3

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
  • 6 replies
  • 1789 views
  • 0 likes
  • 2 in conversation