The SAS Output Delivery System and reporting techniques

Proc Report - Formatting the title

Reply
N/A
Posts: 0

Proc Report - Formatting the title

I have a proc report with a title. I would like to color the background of the title and put a box around it. Any suggestions? My code is below...

ods pdf file='c:\PC_SAS\Test Page.pdf' style=CustPge3 notoc;
title 'Test' ;
proc report data=projects.dataset5;
where dealer_number='0018';
column description cnt amt;
label description = "Compeditor Name"
Cnt = "Transactions"
AMT = "Amount";
run;
ods pdf close;
SAS Super FREQ
Posts: 8,868

Re: Proc Report - Formatting the title

Posted in reply to deleted_user
Hi:
It looks like you're already using a custom STYLE template for your output. The easiest thing to do to alter the title would be to look at changing the SystemTitle style element. Depending on the version of SAS that you're using, you may need/want to change the TitleandNoteContainer style element, too.

To put a box around the title, you would use the FRAME style attribute and you would also probably change the BorderColor, BorderWidth and Background style attributes as well.

cynthia
N/A
Posts: 0

Re: Proc Report - Formatting the title

Posted in reply to Cynthia_sas
That worked! Thank you!

Now that I have the box around the title, is there a way to split it into 2 lines but keep the frame around that title?
SAS Super FREQ
Posts: 8,868

Re: Proc Report - Formatting the title

Posted in reply to deleted_user
Hi:
I believe that if you use 2 Title statements, you will get 2 boxes, one around each title statement text string. If this is not what you want to see, then, your choice is to put a "line feed" or "carriage return" into your title string using ODS ESCAPECHAR techniques.

Depending on your version of SAS (9.1.3 vs 9.2), you may have to use slightly different syntax, but the essential technique is to
1) define an escape character with the ODS ESCAPECHAR statement and then
2) use the escape character appropriately in your code to accomplish the change or effect you want.

These papers illustrate the use of ODS ESCAPECHAR for both SAS 9.1.3 and SAS 9.2.
http://www2.sas.com/proceedings/forum2007/099-2007.pdf
http://www.nesug.org/Proceedings/nesug07/cc/cc18.pdf
http://www.nesug.org/proceedings/nesug08/np/np10.pdf
http://www2.sas.com/proceedings/sugi31/227-31.pdf
http://support.sas.com/resources/papers/sgf2008/odspdf.pdf

cynthia
N/A
Posts: 0

Re: Proc Report - Formatting the title

Posted in reply to Cynthia_sas
ods escapechar '^' worked for the line break. I ended up using ^n.

Thanks again! Thanks for the great links too!
N/A
Posts: 0

Re: Proc Report - Formatting the title

Posted in reply to deleted_user
One last thing, how can the same thing (add border is background color) be done to the title without using the template?
SAS Super FREQ
Posts: 8,868

Re: Proc Report - Formatting the title

Posted in reply to deleted_user
Hi:
Not sure that you can do this without using a template for tabular output -- there are some new bordertopstyle, borderbottomstyle attributes in SAS 9.2 -- but you'd have to use them with ODS ESCAPECHAR methods and I'm not sure they'd work in all destinations. It's possible that you might do it with CSS -- but if you were going to use CSS, you might as well use a template (and you'd need 9.2 to use the new CSSSTYLE for ODS RTF or ODS PDF).

In SAS/GRAPH programs, the BOX option works on the TITLE statement. But for tabular output, that option isn't used by ODS.

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