BookmarkSubscribeRSS Feed
hartwell
Obsidian | Level 7

I am trying to insert pictures within a PROC REPORT.  I believe I understand the basic mechanics, but would like the picture to shrink to fit if the cellwidth is not as wide as the picture.  Is this something that can be done?

 

proc report data=dsn nowd;
    column image;
    define image / "TITLE" computed style(column)=[cellwidth=4in];

    compute image / char;
        call define(_col_,'style',"style=[preimage='/path/SGPlot1.png']");
    endcomp;
run;

The code above is what I used to produce the PROC REPORT to insert a single image.  It cuts off the right-hand side of the image because the image is just a little bit wider than the 4in cellwidth I declared.  I would like it to instead shrink the image.

2 REPLIES 2
Cynthia_sas
Diamond | Level 26
Hi, My experience using images with PROC REPORT and inserting the image into a cell is that the image does not "autosize" -- so I generally had to use a paint program to get the image to the approximate size I needed before I inserted it into the output. It may also make a difference whether your ODS output destination is HTML, RTF, PDF, etc.
Cynthia
Ksharp
Super User

Or you can refit this graph when you are creating "SGPlot1.png". like:

ods graphics/width=500px height=300px image_name="SGPlot" outputfmt=png;

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 432 views
  • 1 like
  • 3 in conversation