<?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: Inserting image in PDF to span multiple titles in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69239#M7960</link>
    <description>Hi:&lt;BR /&gt;
  This worked for me:&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods pdf file='c:\temp\logo_alt.pdf';&lt;BR /&gt;
ods escapechar='~';&lt;BR /&gt;
title j=l '~S={vjust=m} 1) Title line 1~n 2) Another Line~n 3) A third line'&lt;BR /&gt;
      j=r '~S={preimage="c:\temp\kermit.gif"}';&lt;BR /&gt;
      &lt;BR /&gt;
                                                &lt;BR /&gt;
proc report data=sashelp.shoes(obs=6)nowd;&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / 'Region';&lt;BR /&gt;
run;&lt;BR /&gt;
                                 &lt;BR /&gt;
ods pdf close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                &lt;BR /&gt;
But I was also pointing to a local copy of KERMIT.GIF. I notice that you are still using a physical server location for your LOGO and I don't know whether that will work. In my output, the 3 title lines are on the left and a lovely picture of Kermit is on the right and the vjust=m causes my 3 title lines to be middle-aligned with the image of Kermit. If you wanted the 3 titles to be top-aligned, then you would change the attribute to be vjust=t.&lt;BR /&gt;
 &lt;BR /&gt;
If you get the titles, but see a red X for the image, then you have image location issues with the stored process and you may want to work that issue with Tech Support.&lt;BR /&gt;
cynthia</description>
    <pubDate>Fri, 04 Feb 2011 20:50:40 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2011-02-04T20:50:40Z</dc:date>
    <item>
      <title>Inserting image in PDF to span multiple titles</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69234#M7955</link>
      <description>Hello,&lt;BR /&gt;
I want the output in my Excel and PDF to look like this -&lt;BR /&gt;
&lt;BR /&gt;
title1  |------|&lt;BR /&gt;
title2  |IMG|&lt;BR /&gt;
title3  |------|&lt;BR /&gt;
&lt;BR /&gt;
I looked up the forum and SAS Notes but the posts seem to be close but not exactly what I want. &lt;BR /&gt;
Sample 41703: How to wrap text to the right of an image in a title or footnote in an ODS PDF file&lt;BR /&gt;
Usage Note 24229: Can I get images in my titles with ODS PRINTER?&lt;BR /&gt;
&lt;BR /&gt;
This thread comes close -&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=44150걶" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=44150걶&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
But I want this trick to work to both in Excel and PDF and I am not sure how to design the Title statement for this. The code (we are running Stored Processes) is here -&lt;BR /&gt;
&lt;BR /&gt;
%macro header;&lt;BR /&gt;
&lt;BR /&gt;
%IF &amp;amp;format = Excel %THEN %DO; %LET _ODSDEST =tagsets.excelxp ; %LET _ODSSTYLE =; %LET _ODSSTYLESHEET = ; &lt;BR /&gt;
%LET _ODSOPTIONS =options(&lt;BR /&gt;
embedded_titles="yes"&lt;BR /&gt;
autofilter="3-46"&lt;BR /&gt;
frozen_headers="13"&lt;BR /&gt;
/*frozen_rowheaders="2"*/&lt;BR /&gt;
absolute_column_width="8.3,11,7,9,8,8"&lt;BR /&gt;
autofit_height="yes"&lt;BR /&gt;
/*autofit_width="no"*/&lt;BR /&gt;
sheet_label="test"&lt;BR /&gt;
/*wraptext="yes"*/&lt;BR /&gt;
/*(mergecell="yes"*/&lt;BR /&gt;
);&lt;BR /&gt;
RUN;&lt;BR /&gt;
DATA _NULL_; rc = STPSRV_HEADER('Content-type', 'application/vnd.ms-excel'); &lt;BR /&gt;
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=tmp.xls');&lt;BR /&gt;
RUN; %END; &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%ELSE %IF &amp;amp;format =  PDF %THEN %DO; %LET _ODSDEST = pdf; %LET _ODSSTYLE = styles.pdftemp; %LET _ODSSTYLESHEET = ; %LET _ODSOPTIONS = BOOKMARKGEN=NO COMPRESS=9 STARTPAGE=NO; DATA _NULL_; rc = STPSRV_HEADER(&lt;BR /&gt;
'Content-type', 'application/pdf'); &lt;BR /&gt;
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=Test_op_prgm_smry.pdf'); RUN; %END ;&lt;BR /&gt;
&lt;BR /&gt;
%ELSE %IF  &amp;amp;format =  %THEN %DO; %LET _ODSDEST = ; %LET _ODSSTYLE = ; %LET _ODSSTYLESHEET = ; %LET _ODSOPTIONS = ; DATA _NULL_; rc = STPSRV_HEADER('Content-type', 'application/vnd.ms-excel'); &lt;BR /&gt;
rc = STPSRV_HEADER('Content-disposition', 'attachment; filename=Test_op_prgm_smry.xls'); RUN; %END; &lt;BR /&gt;
&lt;BR /&gt;
%ELSE %IF &amp;amp;format = HTML %THEN %DO; RUN; %END; &lt;BR /&gt;
%mend;&lt;BR /&gt;
%header;&lt;BR /&gt;
&lt;BR /&gt;
ods escapechar='^';&lt;BR /&gt;
title j=left HEIGHT=3 COLOR=BLACK FONT=verdana 'Online Summary' j=c "^S={preimage='/sasdev/../logo.bmp'}";&lt;BR /&gt;
title2;*not including the entire line of code;&lt;BR /&gt;
title3;&lt;BR /&gt;
&lt;BR /&gt;
If I can get the trick for PDF alone, that also works for me.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
      <pubDate>Fri, 04 Feb 2011 17:53:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69234#M7955</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-02-04T17:53:38Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting image in PDF to span multiple titles</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69235#M7956</link>
      <description>Hi: &lt;BR /&gt;
&lt;BR /&gt;
  I am not sure that you can get the same code working for both Excel and PDF -- they are 2 fundamentally different destinations.&lt;BR /&gt;
&lt;BR /&gt;
  Plus, TAGSETS.EXCELXP creates Excel 2003 XML, which &lt;U&gt;by Microsoft design&lt;/U&gt;, does not allow the use of images. For example, if you try to use GCHART with TAGSETS.EXCELXP, you see this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
390  ods tagsets.excelxp file='c:\temp\someimage.xls' style=sasweb;&lt;BR /&gt;
NOTE: Writing TAGSETS.EXCELXP Body file: c:\temp\someimage.xls&lt;BR /&gt;
NOTE: This is the Excel XP tagset (Compatible with SAS 9.1.3 and above, v1.94, 09/09/12).&lt;BR /&gt;
Add options(doc='help') to the ods statement for more information.&lt;BR /&gt;
391    ods escapechar='~';&lt;BR /&gt;
392    proc gchart data=sashelp.class;&lt;BR /&gt;
393      vbar sex / sumvar=height type=mean;&lt;BR /&gt;
394    run;&lt;BR /&gt;
            &lt;BR /&gt;
Excel XML does not support output from Proc:Gchart&lt;BR /&gt;
Output will not be created.&lt;BR /&gt;
NOTE: 2 records written to c:\temp\output\gchart.png.&lt;BR /&gt;
395    quit;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                 &lt;BR /&gt;
It doesn't matter whether you are using PROC GCHART or PREIMAGE -- TAGSETS.EXCELXP will NOT use images. You might have to switch to an HTML-based destination in order to get images to work with Excel when the file is opened.&lt;BR /&gt;
&lt;BR /&gt;
Again, since stored processes are involved, you may wish to work with Tech Support on this question.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 04 Feb 2011 18:30:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69235#M7956</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-04T18:30:03Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting image in PDF to span multiple titles</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69236#M7957</link>
      <description>Hi Cynthia,&lt;BR /&gt;
Do you know if we can make it work for PDF atleast? I did learn from our earlier discussions that ExcelXp wont like images.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,</description>
      <pubDate>Fri, 04 Feb 2011 18:39:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69236#M7957</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-02-04T18:39:37Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting image in PDF to span multiple titles</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69237#M7958</link>
      <description>Hi:&lt;BR /&gt;
  If that previous forum posting provides code that does what you want, then I don't know what you mean when you ask:&lt;BR /&gt;
&lt;B&gt;&lt;I&gt;Do you know if we can make it work for PDF at least?&lt;/I&gt;&lt;/B&gt;&lt;I&gt;&lt;/I&gt;&lt;BR /&gt;
 &lt;BR /&gt;
Make what work??? In your original post, you showed this:&lt;BR /&gt;
[pre]&lt;BR /&gt;
title1 |------|&lt;BR /&gt;
title2 |IMG|&lt;BR /&gt;
title3 |------|&lt;BR /&gt;
[/pre]&lt;BR /&gt;
 &lt;BR /&gt;
I don't know what the above drawing means...you want title1 text string, then an image underneath title1 and then you want title3 to be underneath the image??? &lt;BR /&gt;
&lt;BR /&gt;
Did you try the code from the previous forum posting (at the bottom)??&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods pdf file='c:\temp\logo_labelx.pdf';&lt;BR /&gt;
ods escapechar='~';&lt;BR /&gt;
title j=l '~S={preimage="c:\temp\kermit.gif"}'&lt;BR /&gt;
      j=c '~S={vjust=m} 1) Title line 1~n Another Line~n A third line';&lt;BR /&gt;
                        &lt;BR /&gt;
proc report data=sashelp.shoes(obs=6)nowd;&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / 'Region';&lt;BR /&gt;
run;&lt;BR /&gt;
                       &lt;BR /&gt;
ods pdf close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
            &lt;BR /&gt;
If so, can you explain how you would change this above output in PDF to be what you want??? If you need MORE control over image or text placement, then you may be looking at using ODS LAYOUT with ODS PDF to do what you want.&lt;BR /&gt;
 &lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 04 Feb 2011 19:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69237#M7958</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-04T19:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting image in PDF to span multiple titles</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69238#M7959</link>
      <description>Hi,&lt;BR /&gt;
I tried the code from the posting but it does not seem to work for me. &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; I will try to be more simple this time.&lt;BR /&gt;
I need 3 titles on the top left corner and the image on the top right corner.&lt;BR /&gt;
&lt;BR /&gt;
Here is my code -&lt;BR /&gt;
&lt;BR /&gt;
ods escapechar='^';&lt;BR /&gt;
title1 j=l HEIGHT=3 COLOR=BLACK FONT=verdana &lt;BR /&gt;
     "^S=(vjust=l) Online  Summary^n&amp;amp;STARTDATE to &amp;amp;ENDDATE^n&amp;amp;ReportDescription"  &lt;BR /&gt;
       j=r "^S={preimage='/sasdev/.../logo.bmp'}";&lt;BR /&gt;
&lt;BR /&gt;
Thanks</description>
      <pubDate>Fri, 04 Feb 2011 20:15:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69238#M7959</guid>
      <dc:creator>saspert</dc:creator>
      <dc:date>2011-02-04T20:15:56Z</dc:date>
    </item>
    <item>
      <title>Re: Inserting image in PDF to span multiple titles</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69239#M7960</link>
      <description>Hi:&lt;BR /&gt;
  This worked for me:&lt;BR /&gt;
[pre]&lt;BR /&gt;
ods pdf file='c:\temp\logo_alt.pdf';&lt;BR /&gt;
ods escapechar='~';&lt;BR /&gt;
title j=l '~S={vjust=m} 1) Title line 1~n 2) Another Line~n 3) A third line'&lt;BR /&gt;
      j=r '~S={preimage="c:\temp\kermit.gif"}';&lt;BR /&gt;
      &lt;BR /&gt;
                                                &lt;BR /&gt;
proc report data=sashelp.shoes(obs=6)nowd;&lt;BR /&gt;
  column region product sales;&lt;BR /&gt;
  define region / 'Region';&lt;BR /&gt;
run;&lt;BR /&gt;
                                 &lt;BR /&gt;
ods pdf close;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
                &lt;BR /&gt;
But I was also pointing to a local copy of KERMIT.GIF. I notice that you are still using a physical server location for your LOGO and I don't know whether that will work. In my output, the 3 title lines are on the left and a lovely picture of Kermit is on the right and the vjust=m causes my 3 title lines to be middle-aligned with the image of Kermit. If you wanted the 3 titles to be top-aligned, then you would change the attribute to be vjust=t.&lt;BR /&gt;
 &lt;BR /&gt;
If you get the titles, but see a red X for the image, then you have image location issues with the stored process and you may want to work that issue with Tech Support.&lt;BR /&gt;
cynthia</description>
      <pubDate>Fri, 04 Feb 2011 20:50:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Inserting-image-in-PDF-to-span-multiple-titles/m-p/69239#M7960</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2011-02-04T20:50:40Z</dc:date>
    </item>
  </channel>
</rss>

