This question was first posted in the base Programming forum but probably belongs here.
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;
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.
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.
@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 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.