Data visualization with SAS programming

I am trouble with ODS EXCEL and outputing a layout lattice to xlsx tab and keeping its SIze

Reply
New Contributor
Posts: 4

I am trouble with ODS EXCEL and outputing a layout lattice to xlsx tab and keeping its SIze

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

Super User
Posts: 11,134

Re: I am trouble with ODS EXCEL and outputing a layout lattice to xlsx tab and keeping its SIze

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.

New Contributor
Posts: 4

Re: I am trouble with ODS EXCEL and outputing a layout lattice to xlsx tab and keeping its SIze


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?

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