BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Abud
Calcite | Level 5

Hi, everbody!!!

Since last monday,

I've been trying to put a logo on the top left using proc template and preimage.

I'd like to now if this is possible.....because I couldn't do that....

thanks in advanced.....

Abud.

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  If you look on page 465, you will see an example of using the TITLE statement method. Here's my take on the  TITLE statement method compared to the TEMPLATE method:

1) I think the TEMPLATE method is good when you have a logo on the title line and only a logo (no other text). If you want to left justify the logo, then any other text on the title statement will also be left justified. For example, if your LOGO is an image that also contains the company name in the right color and correct size next to the image, then it makes sense to me to have a TEMPLATE for the logo in preimage. Your TITLE statement is "self-contained", but if you have a small LOGO and you want some extra text to appear on the same line as the logo, then you might have alignment issues, see  #2)

2) when you use the TEMPLATE method -- any title text that you add is vertically aligned to the bottom of the image and there's not a good way to ONLY align the text separately from the image (such as a left-justified logo and a center-justified title string). In the book, we mostly showed just a logo on a line or a logo that had the company name in the image.

3) When you use the TEMPLATE method, ALL your TITLE statements will have the logo if you only use CLASS SYSTEMTITLE -- so you pretty much either limit yourself to 1 and only 1 title statement or you have to modify your style template to CLASS statements for SYSTEMTITLE2 -SYSTEMTITLE10. And while this is not a big deal if you are working with templates anyway, if your only purpose for the template is for the logo, then you may as well use the TITLE statement method. (see the screen shot -- this happened because my template had CLASS SYSTEMTITLE, with no other controls for TITLE2-TITLE10.

4) The TITLE statement method in my opinion, gives you a bit more control when you want to have a logo and text on the same line AND you don't have to worry about the other TITLE statements getting the preimage. Note, how in my second screen shot, the TITLE text is centered and "middle" aligned while the logo is left justified. That was entirely done using this single TITLE statement shown below.

cynthia


** Method2 use title statement;
** can justify LOGO separately from TITLE;
** and you can alter the vertical justification of the title;
ODS PDF FILE="c:\temp\uselogo2.pdf";     

ods escapechar='~';
proc means data=sashelp.shoes n mean std min max maxdec=2;
  title j=l "~{style[preimage='c:\temp\sm_logo.png'] } "
        j=c "~{style[vjust=m]Shoe Sales Report}";
  var sales;
run;
ODS PDF CLOSE;


left_logo_center_middle_title.pngsystemtitle_undesired.png

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

Hi:

There have been many previous forum postings about this method for inserting a logo into ODS output (template method) and using a TITLE statement method for inserting a logo into ODS output. The answer to your question, also depends on the destination that you want -- for example, if you had said you were using ODS CSV, I would say that CSV files (comma separated files) do not contain references to images. If you were using ODS LISTING to create an external file, I would say the same thing. If you are using ODS HTML, (or most of the other HTML destinations), ODS RTF, ODS PDF, then inserting an image via template or TITLE statement should work. If, on the other hand, you are using ODS TAGSETS.EXCELXP, then by MICROSOFT design, the type of Spreadsheet Markup XML that you are creating with TAGSETS.EXCELXP does not support images. That was a Microsoft decision for how their XML would work -- SAS can't put an image into the Office 2003 XML file if Microsoft doesn't allow it.

In general, depending on your destination, I would recommend that you start with something like this:

ods escapechar='~';

 

for HTML files, if the image is on a web server:

title j=l '~S={preimage="http://www.server.com/myimage.png"}'

      j=c 'My Title';

 

for RTF and PDF:

title j=l '~S={preimage="c:\temp\myimage.png"}'

      j=c 'My Title';

As I said, there have been many previous forum postings on this topic and many user group papers that illustrate the title method. If you really need the template method, then I'd recommend working with Tech Support.

cynthia

Abud
Calcite | Level 5

Hi! Cynthia!

How are you ?

I've bought your book ( it's very nice) and I'm trying to do the example of page 462 ("adding images to each page of your rtf output).

I'm using PDF.

My Doubt is:

Can I put a picture on the left and some words in the middle (in the same line), using "Class systemtitle" ?

I think if you look at the picture, I'll understand what I'm trying to do....

Page463.JPG

tk's in advanced......


Cynthia_sas
SAS Super FREQ

Hi:

  If you look on page 465, you will see an example of using the TITLE statement method. Here's my take on the  TITLE statement method compared to the TEMPLATE method:

1) I think the TEMPLATE method is good when you have a logo on the title line and only a logo (no other text). If you want to left justify the logo, then any other text on the title statement will also be left justified. For example, if your LOGO is an image that also contains the company name in the right color and correct size next to the image, then it makes sense to me to have a TEMPLATE for the logo in preimage. Your TITLE statement is "self-contained", but if you have a small LOGO and you want some extra text to appear on the same line as the logo, then you might have alignment issues, see  #2)

2) when you use the TEMPLATE method -- any title text that you add is vertically aligned to the bottom of the image and there's not a good way to ONLY align the text separately from the image (such as a left-justified logo and a center-justified title string). In the book, we mostly showed just a logo on a line or a logo that had the company name in the image.

3) When you use the TEMPLATE method, ALL your TITLE statements will have the logo if you only use CLASS SYSTEMTITLE -- so you pretty much either limit yourself to 1 and only 1 title statement or you have to modify your style template to CLASS statements for SYSTEMTITLE2 -SYSTEMTITLE10. And while this is not a big deal if you are working with templates anyway, if your only purpose for the template is for the logo, then you may as well use the TITLE statement method. (see the screen shot -- this happened because my template had CLASS SYSTEMTITLE, with no other controls for TITLE2-TITLE10.

4) The TITLE statement method in my opinion, gives you a bit more control when you want to have a logo and text on the same line AND you don't have to worry about the other TITLE statements getting the preimage. Note, how in my second screen shot, the TITLE text is centered and "middle" aligned while the logo is left justified. That was entirely done using this single TITLE statement shown below.

cynthia


** Method2 use title statement;
** can justify LOGO separately from TITLE;
** and you can alter the vertical justification of the title;
ODS PDF FILE="c:\temp\uselogo2.pdf";     

ods escapechar='~';
proc means data=sashelp.shoes n mean std min max maxdec=2;
  title j=l "~{style[preimage='c:\temp\sm_logo.png'] } "
        j=c "~{style[vjust=m]Shoe Sales Report}";
  var sales;
run;
ODS PDF CLOSE;


left_logo_center_middle_title.pngsystemtitle_undesired.png
Abud
Calcite | Level 5

Ok! Cynthia tk's!!!!

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 6087 views
  • 1 like
  • 2 in conversation