<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Headers and Footers in PDF Output on pages with SGPLOT in Graphics Programming</title>
    <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944292#M25042</link>
    <description>&lt;P&gt;Definitely agree &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;, separating the graph title and footnote from the header/footer on a page would be a very nice add in SAS. But your solution gets me very close, so thank you for that. I just need to investigate the sganno option further to work out the placement of both the graph title and footnote on the graph. I'm seeing that there can be multiple rows of text data in the dataset that gets referenced by the option.&lt;/P&gt;</description>
    <pubDate>Tue, 17 Sep 2024 17:24:32 GMT</pubDate>
    <dc:creator>NeilH</dc:creator>
    <dc:date>2024-09-17T17:24:32Z</dc:date>
    <item>
      <title>Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944139#M25035</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to create pdf output that includes multiple runs of sgplot so that the same global header and footer appears on every page. I can get them to appear on pages with only text, but am not sure how to display them on pages with sgplot output. The sgplots themselves have titles and footers within their borders.&lt;BR /&gt;&lt;BR /&gt;In the example below, the header and footnote print on the title page. I would like them to also appear in the subsequent page with the sgplot output. The actual report would have many sgplot calls.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I appreciate anyone's insight on this. Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create test dataset */&lt;BR /&gt;data test1;
input var $ rating1 survey $ source $ section $;
datalines;
f_pr_inst_mean   68 Faculty Acme U  Program
f_pr_national_mean 79 Faculty National Program
s_pr_inst_mean  81 Student Acme U  Program
s_pr_national_mean 78 Student National Program
f_fa_inst_mean  78 Faculty Acme U  Faculty
f_fa_national_mean 86 Faculty National Faculty
s_fa_inst_mean  89 Student Acme U  Faculty
s_fa_national_mean 83 Student National Faculty
f_in_inst_mean  77 Faculty Acme U  Institution
f_in_national_mean 69 Faculty National Institution
s_in_inst_mean  66 Student Acme U  Institution
s_in_national_mean 76 Student National Institution
f_le_inst_mean  89 Faculty Acme U  Leadership
f_le_national_mean 78 Faculty National Leadership
f_ed_inst_mean  75 Faculty Acme U  Education
f_ed_national_mean 84 Faculty National Education
s_ed_inst_mean  83 Student Acme U  Education
s_ed_national_mean 73 Student National Education
;
run;
&lt;BR /&gt;&lt;BR /&gt;/* Output to pdf */
%let school = "Acme U";
goptions reset=all device=SASPRTC;
ods _ALL_ close; 
%let folder = M:\Engagement Surveys - 2024\Scratch\;
%let filename = %sysfunc(dequote(&amp;amp;school));
%let extension = .pdf;
ods pdf (id=1) file="&amp;amp;folder&amp;amp;filename&amp;amp;extension";
options nodate;
&lt;BR /&gt;&lt;BR /&gt;/* Title page with header and footer */
proc odstext;
ods escapechar='~';
title j=r "~S={preimage='C:\Users\nhurwitz\OneDrive - ACAPT\Documents\CoE logo.png' just=c}";
footnote justify=c height=6pt color=black
"©2024: Engagement Survey from  American Council of Academic Physical Therapy (ACAPT – www.acapt.org/excellence) All rights reserved – September 2024)"; 

p '2024 ENGAGEMENT SURVEY MEMBER REPORT:' /
style = {font_weight=bold font_size=18pt just=c width=100% verticalalign=top};
p &amp;amp;school /
style = {font_weight=bold font_size=16pt just=c width=100%};
&lt;BR /&gt;&lt;BR /&gt;/* Sgplot on separate page - no header or footer currently */
ods proclabel = "Section Charts";
proc sgplot data=test1 description="Faculty Survey Response by Section: Institution vs. National";
styleattrs DATACOLORS=(CX94c25b CX8e4133);
title 'Faculty Survey Response by Section: Institution vs. National'; 
where survey = 'Faculty';
vbar section / response=rating1 datalabel=rating1 group=source groupdisplay=cluster clusterwidth=.50 name="vbars";
yaxis label='Level of Agreement' values=(0, 33, 67, 100, 110) valuesdisplay=("Disagree (0)" "Somewhat Disagree (33)" "Somewhat Agree (67)" "Agree (100)");
xaxis display=(nolabel);
keylegend "vbars" / title="";
footnote height=.75 "Bar values represent the average responsive value of students or faculty members across questions in the section";

ods html(id=1) close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Sep 2024 21:12:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944139#M25035</guid>
      <dc:creator>NeilH</dc:creator>
      <dc:date>2024-09-16T21:12:52Z</dc:date>
    </item>
    <item>
      <title>Re: Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944192#M25037</link>
      <description>&lt;P&gt;Try the following code.&lt;/P&gt;
&lt;P&gt;But PROC ODSTEXT only display text one time . if you want it display it on every page, you need include it in TITLE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Create test dataset */data test1;
input var $ rating1 survey $ source $ section $;
datalines;
f_pr_inst_mean   68 Faculty Acme U  Program
f_pr_national_mean 79 Faculty National Program
s_pr_inst_mean  81 Student Acme U  Program
s_pr_national_mean 78 Student National Program
f_fa_inst_mean  78 Faculty Acme U  Faculty
f_fa_national_mean 86 Faculty National Faculty
s_fa_inst_mean  89 Student Acme U  Faculty
s_fa_national_mean 83 Student National Faculty
f_in_inst_mean  77 Faculty Acme U  Institution
f_in_national_mean 69 Faculty National Institution
s_in_inst_mean  66 Student Acme U  Institution
s_in_national_mean 76 Student National Institution
f_le_inst_mean  89 Faculty Acme U  Leadership
f_le_national_mean 78 Faculty National Leadership
f_ed_inst_mean  75 Faculty Acme U  Education
f_ed_national_mean 84 Faculty National Education
s_ed_inst_mean  83 Student Acme U  Education
s_ed_national_mean 73 Student National Education
;
run;
options nodate;
ods escapechar='~';

title j=r "~S={preimage='C:\temp\x3.png' just=c}";
title2 'Faculty Survey Response by Section: Institution vs. National'; 
footnote  "Bar values represent the average responsive value of students or faculty members across questions in the section";
footnote2 "©2024: Engagement Survey from  American Council of Academic Physical Therapy (ACAPT – www.acapt.org/excellence) All rights reserved – September 2024)"; 



/* Output to pdf */
%let school = "Acme";
*goptions reset=all device=SASPRTC;
%let folder = c:\temp\;
%let filename = %sysfunc(dequote(&amp;amp;school));
%let extension = .pdf;
ods _ALL_ close; 
ods proclabel = "Section Charts";
ods pdf file="&amp;amp;folder&amp;amp;filename&amp;amp;extension"    nogtitle nogfootnote    ;
/* Title page with header and footer */
proc odstext;
p '2024 ENGAGEMENT SURVEY MEMBER REPORT:' /style = {font_weight=bold font_size=18pt just=c width=100% verticalalign=top};
p &amp;amp;school /style = {font_weight=bold font_size=16pt just=c width=100%};
run;
/* Sgplot on separate page - no header or footer currently */
proc sgplot data=test1 description="Faculty Survey Response by Section: Institution vs. National";
styleattrs DATACOLORS=(CX94c25b CX8e4133);
where survey = 'Faculty';
vbar section / response=rating1 datalabel=rating1 group=source groupdisplay=cluster clusterwidth=.50 name="vbars";
yaxis label='Level of Agreement' values=(0, 33, 67, 100, 110) valuesdisplay=("Disagree (0)" "Somewhat Disagree (33)" "Somewhat Agree (67)" "Agree (100)");
xaxis display=(nolabel);
keylegend "vbars" / title="";
run;

ods pdf close;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Ksharp_0-1726541937330.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100403iA0E153B1602DDB0C/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Ksharp_0-1726541937330.png" alt="Ksharp_0-1726541937330.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 02:59:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944192#M25037</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2024-09-17T02:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944265#M25040</link>
      <description>&lt;P&gt;Thank you for your response. I do see how setting the title and footnote at the beginning will display it on each page. The issue that I still have - and seen on your output - is that the title and footnote of the sgplot should only appear as part of the chart rather than on each page as well. &lt;FONT size="3"&gt;Is there a way to treat the title and footnote specific to the sgplot calls separately from the global header/footer that appears on every page of the output?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Header on every page:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NeilH_0-1726579769141.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100445i4BA278B219EA8E0B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NeilH_0-1726579769141.png" alt="NeilH_0-1726579769141.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Footer on every page:&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2"&gt;©2024: Engagement Survey from American Council of Academic Physical Therapy (ACAPT – &lt;A href="http://www.acapt.org/excellence" target="_blank" rel="noopener"&gt;www.acapt.org/excellence&lt;/A&gt;) All rights reserved – September 2024)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And then on the pages with sgplot output, in addition to the global header/footer, display the title and footnote of the graph within its borders.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="NeilH_0-1726580622519.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100446i07724E3C60DA892B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="NeilH_0-1726580622519.png" alt="NeilH_0-1726580622519.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 13:50:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944265#M25040</guid>
      <dc:creator>NeilH</dc:creator>
      <dc:date>2024-09-17T13:50:49Z</dc:date>
    </item>
    <item>
      <title>Re: Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944274#M25041</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/465151"&gt;@NeilH&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you for your response. I do see how setting the title and footnote at the beginning will display it on each page. The issue that I still have - and seen on your output - is that the title and footnote of the sgplot should only appear as part of the chart rather than on each page as well. &lt;FONT size="3"&gt;Is there a way to treat the title and footnote specific to the sgplot calls separately from the global header/footer that appears on every page of the output?&lt;/FONT&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I don't think you can get exactly what you want just from title and footnote statements.&amp;nbsp; The SAS session only has one set of titles.&amp;nbsp; When you make a graph, you can choose whether you want the title to be part of the graph or as a header on the page.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you don't have separate titles for the graph, so you can't say "Make this a title for the page header, and then make this other thing a title for the graph".&amp;nbsp; It's a reasonable idea for a ballot submission, because that would be handy to have.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the absence of that, I think you're stuck using title/footnote statements for the header/footer of your pdf.&amp;nbsp; Then for the title that is part of a graph, if you want it to make it part of the graph box you might have to use a different approach, maybe using annotate (SGANNO) to write the title text.&amp;nbsp; Something like:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%sganno;

data mytitle;
 %sgtext(label='My Title For My Graph', textsize=12,anchor="TOP",y1=100,y1space='GRAPHPERCENT',width=100,widthunit="PERCENT")
run;

title1 "My global title" ;
ods pdf file="Q:\junk\foo.pdf" nogtitle ;
proc sgplot data=sashelp.class sganno=mytitle pad=(top=5%);
  scatter x=age y=height ;
run ;
ods pdf close ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Which generates:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Quentin_0-1726583510613.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100447i7F468E71B5A3B9EA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Quentin_0-1726583510613.png" alt="Quentin_0-1726583510613.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 14:34:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944274#M25041</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-09-17T14:34:37Z</dc:date>
    </item>
    <item>
      <title>Re: Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944292#M25042</link>
      <description>&lt;P&gt;Definitely agree &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;, separating the graph title and footnote from the header/footer on a page would be a very nice add in SAS. But your solution gets me very close, so thank you for that. I just need to investigate the sganno option further to work out the placement of both the graph title and footnote on the graph. I'm seeing that there can be multiple rows of text data in the dataset that gets referenced by the option.&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 17:24:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944292#M25042</guid>
      <dc:creator>NeilH</dc:creator>
      <dc:date>2024-09-17T17:24:32Z</dc:date>
    </item>
    <item>
      <title>Re: Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944298#M25043</link>
      <description>&lt;P&gt;You can do tons of cool stuff with SGANNO, and you don't have to use those macros, they're just helpers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look for papers/blogs, you'll find plenty.&amp;nbsp; I stole some of the approach in my post from this paper by the great Sanjay Matange:&lt;BR /&gt;&lt;A href="https://pharmasug.org/proceedings/china2014/CC/PharmaSUG-China-2014-CC01.pdf" target="_blank"&gt;https://pharmasug.org/proceedings/china2014/CC/PharmaSUG-China-2014-CC01.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 18:47:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944298#M25043</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2024-09-17T18:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: Headers and Footers in PDF Output on pages with SGPLOT</title>
      <link>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944308#M25044</link>
      <description>&lt;P&gt;Thanks, I'll check it out. I also found this paper:&lt;BR /&gt;&lt;A href="https://support.sas.com/resources/papers/proceedings19/3644-2019.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings19/3644-2019.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Sep 2024 19:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Graphics-Programming/Headers-and-Footers-in-PDF-Output-on-pages-with-SGPLOT/m-p/944308#M25044</guid>
      <dc:creator>NeilH</dc:creator>
      <dc:date>2024-09-17T19:35:52Z</dc:date>
    </item>
  </channel>
</rss>

