BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello everyone

in a report table instead of variables i need a image. Is it possible in the
Base SAS

Can any one please tell the procedure for getting such reports.


Thanks
Sid
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:

You say that instead of variables you need an image in your report table. How will the image be created??? Is it an image like a picture of a product or picture of a person (where the image already exists) or is it an image that you will create with SAS/GRAPH or ODS GRAPHICS????

If there are not to be any variables in your report table, why not just use SAS/GRAPH or ODS GRAPHICS for your image??? If you want to mix variable values and images in a report table, then look at figure 18 in this paper:
http://www2.sas.com/proceedings/forum2007/099-2007.pdf

or at these examples of using the PREIMAGE style attribute
http://www2.sas.com/proceedings/sugi31/116-31.pdf (figures 3, 4, 5b)

or example 5 and 6 in this paper:
http://www.lexjansen.com/pharmasug/2008/sas/sa08.pdf

With the PREIMAGE or POSTIMAGE style attribute, you can insert an image into a table. Most often, people use PREIMAGE and POSTIMAGE to insert a logo into a report, but you can also insert an image into a table cell or before or after a table. Depending on your destination of choice (RTF, PDF, HTML), you may want to be sure that the image is the correct size prior to using it with ODS. Also, the method that you use with PREIMAGE/POSTIMAGE will vary depending on whether you use PROC PRINT or PROC REPORT for your report table, Most of the examples in the papers above use PROC REPORT to insert images into the report table.

cynthia
deleted_user
Not applicable
Thanks Cynthia

in my report i want to insert a image (i.e pre existing in my system) in the column instead of the variable name. I want to do it just for one column

is it possible with PREIMAGE or POSTIMAGE attribute in BASE SAS
Cynthia_sas
SAS Super FREQ
Hi:
Yes, this is possible with ODS -- ODS is part of Base SAS. However, it is NOT possible in the LISTING destination.

PREIMAGE/POSTIMAGE only work for ODS destinations that support style attribute usage and support images (ODS RTF, PDF and HTML support images; ODS CSV does not support style or images, for example). What is your destination of interest???

I have an image on my system called c:\temp\KERMIT.JPG and the program shown below uses that picture of Kermit instead of the variable name for the HEIGHT variable in my report table. If you do not have an image called KERMIT.JPG, you would have to change the image name appropriately in order to see similar results. The example below uses ODS RTF, but you could use similar syntax with ODS PDF or ODS HTML.

cynthia
[pre]
ods rtf file='c:\temp\useimage.rtf';

proc report data=sashelp.class nowd;
column name age height weight;
define name / order;
define age / display ;
define height / display ' '
style(header)={preimage='c:\temp\kermit.jpg'};
define weight /display;
run;

ods rtf close;
[/pre]

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
  • 950 views
  • 0 likes
  • 2 in conversation