BookmarkSubscribeRSS Feed
RussellAlmeida
Calcite | Level 5
Hi,

I am using ODS PDF to generate a report which uses an image as a letter head. Just under the image i would like to insert the field date and contact information.

Any suggestion.

I am attaching the code which i have written to get the report.

Where should i put the option ASIS = ON in the proc report code?????

OS:AIX
SAS Version: SAS 9.1.3
Method: ODS PDF


SAS CODE
000000000000000000000000000000000000000000000


ods escapechar='~';

ODS _ALL_ CLOSE;
options nobyline nonumber linesize=max pagesize=60 nocenter nodate asis=ON ;
ods pdf file="RD040.pdf" notoc style = printer;
;
proc report data=RD040_PKS_LETTER_TO_PRINT
out = RD040_PKS_Letter_Status
(keep =
ref_no
date_printed
report_no
rename = (ref_no = Ref_Order_Number))
nowd noheader

style(report)={rules=none frame=void cellspacing=0 leftmargin = 5 cellpadding=3 outputwidth=100%} ;
title h=14pt ' ~10n';

footnote ' ';

column ref_no lineno linetxt date_printed report_no;

define date_printed/noprint;
define report_no/noprint;
define ref_no / order noprint;
define lineno / order noprint;
define linetxt/
style(column)={font_face='times'};
compute linetxt;
if lineno in (1,2,3) then do;
call define(_col_,'style','style={font_size=15pt}');
end;
else if lineno in(4) then do;
call define(_col_,'style','style={font_weight=bold font_size=15pt just=left}');
end;
else do;
call define(_col_,'style','style={font_weight=medium font_size=15pt}');
end;
endcomp;

title1 j=R '~S={preimage="/UETLDVH/config/ETL1DVH/images/Posten_Logo.jpg"}';
title2 ' hello world';

break after ref_no / page;
run;

000000000000000000000000000000000000000000000

Regards
Russell
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
ASIS=ON is used to preserve leading and trailing spaces in a cell. But I guess I'm confused about a few things about your question and your code:
1) where do you want to preserve leading or trailing spaces in your report?

2) what led you to conclude that you needed ASIS=ON?

3) In your code you have these TITLE statements. So, my question to you is, does the string "hello world" appear underneath the logo where you want the date and contact information????:
[pre]
title1 j=R '~S={preimage="/UETLDVH/config/ETL1DVH/images/Posten_Logo.jpg"}';
title2 ' hello world';
[/pre]

4) based on some of your previous postings, I seem to remember that you are using stored processes???? Is this program part of a stored process and, if so, which client applications will be receiving the PDF results??

cynthia
RussellAlmeida
Calcite | Level 5
Hi Cynthia,

yes I am using stored process.

I put the hello world under the image and was thinking of using the ASIs option to indent the text to come under the image which is right justified. Once that was possible replace the text with teh correct text.

Also I thought of ASIS because it's more than one value hwich will come under the inage. Using the ASIs option will help me get the text in the place where I need.

We are surfacing the stored process thru the SAS Information Delivery Portal.

You can suggest another alternative if possible.

Regards
Russell Message was edited by: Russell Almeida
Cynthia_sas
SAS Super FREQ
Hi:
OK...here goes.

If this were BASE SAS, I'd just suggest using ODS ESCAPECHAR and a NON-BREAKING space (ESCAPECHAR+UNDERSCORE). So, for example:
[pre]
title1 j=R '~S={preimage="/UETLDVH/config/ETL1DVH/images/Posten_Logo.jpg"}';
title2 ' ~S={asis=on}~_~_~_~_~_}hello world';
[/pre]

If the ESCAPECHAR is set to tilde (~), then every ~_ would be one non-breaking space and the ~S style override is the way that ODS ESCAPECHAR syntax would be used to pass ASIS=ON to ODS PDF.

OK...now some stored process specific comments:
1) Generally, your stored process cannot write to your LOCAL drive. So either you replace this:
[pre]
ods pdf file="RD040.pdf" notoc style = printer;
WITH
ods pdf file=_webout notoc style = printer;
[/pre]

and possibly use the STPSRV_HEADER function BEFORE the ODS PDF step (assuming you're going to run the stored process in the PORTAL). OR, you must use the *ProcessBody and the %STPBEGIN/%STPEND stored process macros instead of the ODS PDF OPEN and CLOSE statements. Information about STPSRV_HEADER for PDF:
http://support.sas.com/kb/12/994.html

2) Depending on WHERE you run your stored process, the location of the LOGO file, has to be a location that is accessible to either the Stored Process Server or the Workspace Server. These servers do not have any visibility of your local machine. When an RTF file or a PDF file is created and that file uses images, the images are converted to "internal" or embedded images. So the location you must specify in your PREIMAGE= attribute is the location where the image will be located when the PDF file is CREATED....this means in a location available to the server.

3) Remember that when you create PDF output from a stored process, you are limiting which client applications can run the stored process. For example, PDF results are only "received" by SAS Enterprise Guide, by the SAS Information Delivery Portal and/or by a custom call to the Stored Process Web Application. You will NOT be able to run this SP code from within WRS or the SAS Add-in for Microsoft Office.

cynthia
BenthamLEE
Calcite | Level 5

If you want to insert and create a text annotation contating the field date and contact information under the image, you can try to use the document image annotation tool if your image processing application including a annotator. If your current image editing program doesn't support adding and creating text annotation, you may use a annoation compatible document image reader, such as the well know Adobe reader that contains the text annotation control. Or just search via google to install and apply a free annotation plugin within your document image editor.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 1257 views
  • 0 likes
  • 3 in conversation