BookmarkSubscribeRSS Feed
ArtC
Rhodochrosite | Level 12

This question was first posted in the base Programming forum but probably belongs here.

http://communities.sas.com/t5/SAS-Procedures/Vertical-Adjustment-of-text-in-a-PROC-REPORT-cell-with-...

 

I am using CALL DEFINE to place images in a PROC REPORT text cell.  I would like the text to adjust vertically and if possible to have the images (PREIMAGE and POSTIMAGE) aligned with each other vertically. Clearly the VJUST is not doing anything and I am looking for suggestions.  An image of the current PDF output is attached.  Because of constraints not shown here, the style needs to be declared in the CALL DEFINE.

 

ods pdf file='c:\temp\wrap.pdf';
proc report data=class;
   column name age text;
   compute text;
      length style $200;
      style= 'style={cellwidth=2in vjust=t preimage="c:\temp\male.jpg" postimage="c:\temp\female.jpg"}';
      call define('text','style',style);
   endcomp;
   run;
ods pdf close;

3 REPLIES 3
ArtC
Rhodochrosite | Level 12

Clarification on the problems that i am trying to solve:
1) Pre and post images are not on the same line
2) the postimage causes a large white space to be embedded within the text.
It would be nice if i could move the text up between the two images with the images in the upper left and upper right corners of the cell.


want.PNG
ballardw
Super User

This may be a bit kludgy but with your desired appearance I would be tempted to use 3 cells in a row. The left and right would contain the images (possibly conditionally based on value of an indicator variable) and the desired text in the middle cell. This would allow both image cells to use preimage if that isn't causing appearance issues the postimage seems to.

Use style overrides to make the left/right cell borders if you are using them, to a width of 0 so they don't appear to actually be there.

 

Just a guess. I don't actually work with the pre- and post- image as such fancy graphics have not been requested in tables.

ArtC
Rhodochrosite | Level 12

@ballardwthis is the only solution that I have been able to think of, but was hoping for something less programming intensive.  In my case it would be quite akward as I already have ACROSS variables with a variable number of elements, and these are being addressed using multiple arrays per column.

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
  • 3 replies
  • 3044 views
  • 0 likes
  • 2 in conversation