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