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?

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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