The SAS Output Delivery System and reporting techniques

Border around multi-line title using ExcelXP?

Reply
Frequent Contributor
Posts: 84

Border around multi-line title using ExcelXP?

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;

SAS Super FREQ
Posts: 8,721

Re: Border around multi-line title using ExcelXP?

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;

Frequent Contributor
Posts: 84

Re: Border around multi-line title using ExcelXP?

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.

SAS Super FREQ
Posts: 8,721

Re: Border around multi-line title using ExcelXP?

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

Frequent Contributor
Posts: 84

Re: Border around multi-line title using ExcelXP?

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;

SAS Super FREQ
Posts: 8,721

Re: Border around multi-line title using ExcelXP?

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

Frequent Contributor
Posts: 84

Re: Border around multi-line title using ExcelXP?

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

Ask a Question
Discussion stats
  • 6 replies
  • 647 views
  • 0 likes
  • 2 in conversation