BookmarkSubscribeRSS Feed
AmfamNate
Calcite | Level 5

Hi all,

I am working with ODS Excel to build an Excel Workbook that will act like a scorecard.  My problem is I need the graphic output to be a certain size in excel, but when it renders in Excel it defaults to 6.61 inches wide.  Has anyone encountered this?  Below is basically my code that I am using but very dummied down and using sashelp dataset.

data class;
set sashelp.class;
proc sort; by sex;
run;


ods listing close;


ODS EXCEL file="test.xlsx"    ;
ods excel options(sheet_name="Performance"
    fittopage='OFF'
    orientation='landscape');


%macro graph();

proc template;
define statgraph barchart ;
  begingraph /  designwidth=11in designheight=9in ;


   layout lattice / columns = 4 rows = 2 ;
    %do i = 1 %to  8;
        layout overlay/  ;


seriesplot x=sex  y= weight / display=all  lineattrs=(color=black pattern=solid) markerattrs= (symbol=circlefilled) legendlabel="ConversionRatio" name= "ser" ;
     endlayout;
%end;
  endlayout;

    endgraph;
  end;
run;
proc sgrender data=class template=barchart;
run;
%mend;
%graph();

Thanks for any help on this

Nate

2 REPLIES 2
ballardw
Super User

Have you tried anything like:

ods graphics / height=4in width=3in;

before any procedure that produces output?

You may also want to consider scale=off if text in the graph gets too big or small.

AmfamNate
Calcite | Level 5


I tried using the ods graphic options, but it still downsizes compared to the 11 or 12 inch width I am trying to accomplish.  When I put in above 12 inch width I get the below warning.

WARNING: WIDTH exceeds available space for EXCEL destination. Setting WIDTH=1.09375in.

So does ODS Excel put a limit on the size of graphic it is rendering?

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

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