BookmarkSubscribeRSS Feed
deleted_user
Not applicable
hi all
i m using proc report to generate a pdf file
i want to insert company logo at the top - left of each pdf page
can any one tell me how to do this
thank you
8 REPLIES 8
Cynthia_sas
SAS Super FREQ
Hi:
There are 2 ways to insert a logo in a PDF file:
1) change the style template that you're using with the PDF destination and change the style element that controls the document (I think it's either the BODY element or the TABLE element) -- using the PREIMAGE attribute to point to the location of the logo that you want to insert. You should check with Tech Support for help with this method.

2) if you want the image in the title (at the top of the report), use the preimage attribute in the title statement -- with ODS ESCAPECHAR to put a style override in the title statement. This second method is shown in the code below. Just a few notes:
--for PDF, the location of the logo is where the logo will be at when the output file is CREATED
--if the logo changes, the logo in the PDF report will not change because the image is converted at CREATION time to internal PDF format.
--the image should be close to the size you want because PDF doesn't have a way to size the image (with HTML you might be able to resize the image with HTML tags -- there's no ability like this in PDF)

cynthia

[pre]
** Where I have C:\TEMP\KERMIT.GIF in the code below, you put the location of your logo;

options nodate nonumber center orientation=portrait;
ods listing close;
ods pdf file='c:\temp\logo.pdf';

ods escapechar='~';
title j=l '~S={preimage="c:\temp\kermit.gif"}'
j=c 'The Title of the Report';
footnote j=r 'Page ~{thispage} of ~{lastpage}';

proc report data=sashelp.shoes(obs=60)nowd;
column region product sales;
run;

ods pdf close;
[/pre]
475769
Calcite | Level 5
Hi Cynthia,

Are we able to insert logo in Proc Template?
Cynthia_sas
SAS Super FREQ
Hi:
Yes, that was #1 method in my answer. I showed code for the #2 method. The #1 method means that you have to figure out what style element should change for your destination. I think it's the BODY style element for HTML and possibly the TABLE element for other destinations.

The code for the #1 method is really too long to post and is too destination specific. For HTML -- the image has to be the location where the image will be retrieved from when the HTML page is VIEWED in the browser. For RTF and PDF -- the image location has to be the location where the image will be retrieved from when the RTF or PDF file is CREATED. Tech Support can help you with this style template method.

cynthia
deleted_user
Not applicable
Hi cynthia,

Insert of going through coding, shall we change logo in the servers?
if yes, how can it possible, pls guide me


Thanks in advance
Cynthia_sas
SAS Super FREQ
Hi:
I am not sure what you mean by "change logo in the servers". If you are using Base SAS and ODS and you want to insert a logo in your ODS results file, then the 2 methods that I outline above are the only methods that I know about.

If, on the other hand, you are talking about using SAS Enterprise Guide, Enterprise Miner, Forecast Studio, JMP, the SAS Add-in for Microsoft Office, Web Report Studio, the SAS Information Delivery Portal or ????? I am not sure how all of those products or solutions or client applications use logos. For example, if you are running SAS Web Report Studio under the SAS Enterprise Intelligence Platform (also known as the BI Platform), you have to register your logos and images in the metadata before they can be used on a WRS report.

Your best resource, at this point, might be to open a track with Tech Support to clarify how to do what you want to do with logos, depending on your SAS configuration and the product where you want to use a logo. To open a track with Tech Support, go to:
http://support.sas.com/ctx/supportform/createForm


cynthia
deleted_user
Not applicable
Hi,

I got the answer from below links

http://support.sas.com/kb/18/826.html


thanks cynthia
saspert
Pyrite | Level 9
Hi Cynthia,
Can you help me do a similar thing in Excel?
I am using the following code -
ods html file =''path....\file.xls"
Title "blah"
Title2 "blah blah"
Proc Report data=x style(report)=(preimage='path....\file.jpg')
.....code...
run
ods html close

I want to position the image right next to the titles so that it fits in 2 rows of Excel instead of encompassing several rows from Row#3 to Row #10 (and hiding the data beneath it).

Thanks,
Raj.
Cynthia_sas
SAS Super FREQ
Hi:
When you use ODS HTML to create a file, you are making an ASCII text file of HTML tags. You are not creating a true, binary, .XLS file -- you are only creating an HTML file that Excel can open. Giving the HTML file a ".XLS" extension only fools the Windows registry into launching Excel to open the HTML file.

Normally, an HTML file is opened in the browser and your images will stay in place in the browser, because the browser has a certain way of handling the HTML <IMG> tag. But, Excel is built to render spreadsheets -- opening an HTML file with Excel generally works well for report tables of rows and columns.

One reason I do not use logos or preimage with ODS HTML, if I plan to open the HTML file into Excel, is that Excel seems to "float" the image -- which, for me, has resulted in the image being floated over the data, as you describe.

I do not know a way around this -- to me it seems to be inherent in the way that Excel treats HTML <IMG> tags. So, this is why I suggest you open a track with Tech Support on this issue. They may know of a workaround.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 8 replies
  • 5477 views
  • 1 like
  • 4 in conversation