BookmarkSubscribeRSS Feed
jibra
Obsidian | Level 7

I have created a PDF booklet of graphs that in which I need to format a bit. I am still at student level, and while I find myself able to grasp involved annotations and attributes, I am unable to do seemingly simpler things like the following:

 

1. Insert page number footnotes at the bottom of each graph's page (I used the escapechar with {thispage} function and I could not get it to work... Not sure if my addition of odstext is complicating things. My page numbers need to be below the odstext on each page). As you can see I even tried using an ods escapechar statement within each graph to no avail.

 

2. Place Chart Titles at a customized indentation (I can justify left, center, right, but I have to use spaces to place them at a desired location above my graph).

 

I'm curious if someone can easily see from my code where I'm going wrong (probably at the problem spots).

 

title; footnote;

** change options so no page number on TITLE page;

options nodate nonumber center orientation=portrait ;

data Title;

length tline $200;

tline = '~S={just=c font_weight=bold font_size=22pt font_face=tahoma}Booklet Title'; output;

tline = '~S={just=c font_weight=bold font_size=22pt font_face=tahoma}Booklet Subtitle'; output;

tline = "~S={just=c font_weight=bold font_size=22pt font_face=tahoma}&monyear."; output;

tline = '~S={just=c font_weight=bold font_size=80pt font_face=tahoma} '; output;

/*tline = '~S={just=c font_weight=bold font_size=80pt font_face=tahoma} '; output;*/

tline = '~S={just=c font_weight=bold font_size=50pt font_face=tahoma} '; output;

tline = '~S={just=c font_size=20pt font_face=tahoma}Department Title'; output;

tline = "~S={just=c font_size=20pt font_face=tahoma}&fulldate."; output;

run;

ods listing close;

ods escapechar='~';

ods pdf file='\\serverlocation\SuppTest2.pdf' startpage=yes style=styles.defstyle;

proc report data=title nowd noheader

style(report)={rules=none frame=void cellspacing=0};

title1 j=c '~S={preimage="C:\PictureLocation\BLS2.jpg"} ';

column tline;

define tline / display;

run;

/*Chart 1*/

options gstyle orientation=portrait nodate nonumber pageno=1;

ods graphics on;

ods pdf startpage=now;

ods graphics / reset width=700px height=600px imagename="gridsgplot" imagefmt=gif border=on;

ods escapechar='~';

proc sgplot data=c_jo pad=(bottom=5pct top=5pct) sganno=jp_anno1 noautolegend;

TITLE1 font="helvetica/bold" HEIGHT=1.6 JUSTIFY=LEFT "     Chart 1. Title";

TITLE2 font="helvetica/bold" HEIGHT=1.3 JUSTIFY=LEFT "           Subtitle";

 

band y=r1 lower="01DEC07"d upper="01JUN09"d / transparency=.8 fillattrs=(color=gray4C);

series x=sasdate y=jopu / lineattrs=(color=blue);

xaxis type=time

ranges=("01JAN2005"d - "01&refmofir.&refyear."d)

display=(novalues nolabel )

offsetmin=0.0015 offsetmax=0

;

yaxis label = ' ' grid values = (0 TO 7 BY 1) tickvalueformat=axdeci.

offsetmin=0.0 offsetmax=0.0001

;

 

footnote1 justify=left height=.25 ' ';

footnote2 justify=left height=3.0 ' ';

footnote3 justify=left font=arial height=.888 "Source: GraphFootnote, &PRdate., &refyear..";

footnote4 justify=left height=.8 ' ';

footnote5 justify=left font= arial height=.888 "Note: GraphFootnote2";

run;

proc odstext;

p "";

list / style={liststyletype="disc" fontsize=11pt};

item "Some Text.";

item "Other Text";

item "More Text.";

end;

run;

footnote '~{thispage}';

run;

 

/*Chart 2*/

ods pdf startpage=now;

ods graphics / reset width=700px height=600px imagename="gridsgplot" imagefmt=gif border=on ;

ods escapechar='~';

proc sgplot data=c_jo pad=(bottom=2pct top=2pct) sganno=jp_anno2 noautolegend;

TITLE1 font="helvetica/bold" HEIGHT=1.6 JUSTIFY=LEFT "      Chart 2. Title";

TITLE2 font="helvetica/bold" HEIGHT=1.3 JUSTIFY=LEFT "            Subtitle";

 

band y=r1 lower="01DEC07"d upper="01JUN09"d / transparency=.8 fillattrs=(color=gray4C);

series x=sasdate y=jo / lineattrs=(color=blue);

series x=sasdate y=emp / y2axis lineattrs=(color=green pattern=dash thickness=2);

xaxis type=time

ranges=("01JAN2005"d - "01&refmofir.&refyear."d)

display=(novalues nolabel )

offsetmin=0.0 offsetmax=0.0

;

yaxis label = 'Label 1' LABELATTRS=(Color=blue Family=Arial Size=8 Weight=Bold)

grid values = (2000 to 6000 by 500) valueattrs=(size=8)

offsetmin=0.0001 offsetmax=0.001

;

y2axis label = ' Label 2' LABELATTRS=(Color=Green Family=Arial Size=8 Weight=Bold)

grid values = (129000 TO 145000 by 2000)valueattrs=(size=8)

offsetmin=0.0001 offsetmax=0.001

;

footnote1 justify=left height=.25 ' ';

footnote2 justify=left height=3.0 ' ';

footnote3 justify=left font=arial height=.888 "Source: GraphFootnote, &PRdate., &refyear..";

footnote4 justify=left height=.8 ' ';

footnote5 justify=left font= arial height=.888 "Note: GraphFootnote2";

run;

proc odstext;

p "";

list / style={liststyletype="disc" fontsize=11pt};

item "Some Text.";

item "Other Text";

item "More Text.";

end;

run;

footnote '~{thispage}';

run;

 

ods pdf close;

run;

 

9 REPLIES 9
jibra
Obsidian | Level 7

Yes, and that does not work either. Like I said, maybe something is going on as a result of the odstext statements. If I delete all the source tables for the graphs, the graphs then don't display. The odstext bullet points then move up on each pdf page and the page numbers then display properly. As soon as I add the tables for the graphs and run the program, the graphs display on top, followed by my bulletted text without the page number. I believe I'm doing something wrong on each pdf pages's code. I want to display one chart along with relevant text in bulletted form on each pdf page. See attached. The first one displays the page number when I remove the graph source material and with it the graphs themselves. The second one diplays everything properly except the page number in the footer.


Without Graph Source Tables.JPGWith Graph Source Tables.JPG
Cynthia_sas
SAS Super FREQ
Escapechar + pageof is an RTF only command string. It won't work for PDF.

cynthia
jibra
Obsidian | Level 7

The function ~{thispage} seems to be working in ods pdf when I use the proc odstext by itself. Not with the graphs though. It's almost as if the graphs' inclusion push all the odstext down and with it, the page number out of view--I do need the number to be centered and on the bottom of each pdf page except the title page of course.  I haven't been able to find anythign online about this. I've googled all variations of 'ods pdf odstext sgplot booklet page numbers insert bottom escapechar thispage' and so on. I would welcome more search suggestions.

Cynthia_sas
SAS Super FREQ
Hi:
Please refer to these Tech Support notes, which don't exactly describe your experience, but indicate that there is some kind of issue that has been reported in the past:
http://support.sas.com/kb/24/438.html and
http://support.sas.com/kb/34/573.html. It seems to me that given the issues noted in the past, your best bet for a solution or suggestion might be to work with Tech Support on this.

cynthia
jibra
Obsidian | Level 7

Thanks for your input. The second link takes me to an defunct page. The first link indicates that: "Page numbering is not available with SAS/Graph output routed to the PDF destination until SAS 9.2." I am using 9.4, so I'm not sure why I'm encountering the problem. I will try to contact Tech Support for this I guess.

Cynthia_sas
SAS Super FREQ
This is the link
http://support.sas.com/kb/34/573.html

not sure why it doesn't work for you. Tech Support is probably your best bet.
cynthia
jibra
Obsidian | Level 7

Thanks for your insight. I will try tech support for the page numbers. Any idea how to handle the second part of my original post? Is it possible to do more than justify l, c, r for titles? Right now the only way i can place them exactly where I want on the output is to manipulate their placement using leading spaces within my quotes. I'm not sure if I'm missing some easier way to customize their position exactly where I want them.

Cynthia_sas
SAS Super FREQ
Hi:
Left, right and center are the only controls for titles. Something else might be possible with ODS LAYOUT or the Report Writing Interface, but that would be an entirely different set of controls.

When you are using a proportional font with ODS destinations, there is not the type of "fine" positional control as you would have in a publishing program. If you have a publishing program that consumes HTML, RTF or PDF files, then it might be easier for you to come as close as you can with SAS and then post-edit your file with a publishing application.

cynthia

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 9 replies
  • 9088 views
  • 0 likes
  • 3 in conversation