The SAS Output Delivery System and reporting techniques

Vertical Adjustment of text in a PROC REPORT cell with PREIMAGE

Reply
Valued Guide
Posts: 632

Vertical Adjustment of text in a PROC REPORT cell with PREIMAGE

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;

Valued Guide
Posts: 632

Re: Vertical Adjustment of text in a PROC REPORT cell with PREIMAGE

[ Edited ]

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
Super User
Posts: 11,144

Re: Vertical Adjustment of text in a PROC REPORT cell with PREIMAGE

[ Edited ]

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.

Valued Guide
Posts: 632

Re: Vertical Adjustment of text in a PROC REPORT cell with PREIMAGE

@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.

Ask a Question
Discussion stats
  • 3 replies
  • 756 views
  • 0 likes
  • 2 in conversation