The SAS Output Delivery System and reporting techniques

titles with escapechar and ODS

Not applicable
Posts: 0

titles with escapechar and ODS

I would like to create a standard logo to appear on top left corner of page; On top righr corner of page I need this as well:
Print date: xx/yy/dddd
Page : x of y

I have tried several approaches, and I am close, but the problem is with alignment;

The alignment should be such that , the logo on left side should be about same line as the stuff on the right..
the logo on left side has much bigger font size, and it is essentially spanning two rows, while the stuff on right side has two rows but of lesser font size;

with my code, howver the stuff on right side appears to be below the logo on the left side;

here is one of my attempts;

title1 "~S={just=left font_weight=bold font_style=roman font_size=16pt}COMPANYNAME~S={}~S={just=left font_size=4pt}~{super TM}~S={}~S={vjust=top just=right font_style=roman font_size=5pt font_weight=bold}
&space1 &space1 Print date:~S={vjust=top font_style=roman font_size=5pt just=right font_weight=light}&date1~S={}";

title2 "~S={vjust=top just=right font_style=roman font_size=5pt font_weight=bold} Page: ~{thispage}~S={}";

&space is filler to help push the stuff to right;

I have tried using proc report approach , but the issue remains same;

would appreciate any pointers...

SAS Employee
Posts: 174

Re: titles with escapechar and ODS

Posted in reply to deleted_user

I recommend that you contact Technical Support at .

-- David Kelley, SAS
Occasional Contributor
Posts: 14

titles with escapechar and ODS

Posted in reply to deleted_user

Try this

ods pdf file = 'test.pdf';

ods escapechar = '^';

* Your image has to be of proper size;

* you can also make logo left or right justify;

title "^S={preimage='C:\Users\sas.jpg'}";

proc print data = sashelp.class;


ods pdf close;

New Contributor
Posts: 3

Re: titles with escapechar and ODS

Posted in reply to deleted_user

Can you use ODS HTML TEXT / or a tagset? 

Also could you use a preHTML function on a proc report?  What is the desired output format?

ODS HTML TEXT="<DIV align=Left style='position:absolute; top:1px;'><IMG Src='Filename.jpg'></DIV>


PROC REPORT DATA=FINAL LS=256 STYLE(report)={prehtml="<DIV align=Left style='position:absolute; top:1px;'><IMG Src='Filename.jpg'></DIV>

" rules=none}; -Tony

Posts: 9,370

titles with escapechar and ODS

ODS HTML <DIV> tags will not work with PDF. The OP said PDF was the desired destination. Possibly there might be something to do with CSS -- but the bigger problem is that in a separate posting the same OP said he needed the logo to print even if the PROC generated no output -- so the logo on an empty page. Don't know whether that is still a requirement or not, but a complication.


Ask a Question
Discussion stats
  • 4 replies
  • 5 in conversation