The SAS Output Delivery System and reporting techniques

sas ods pdf and gkpi

Reply
Occasional Contributor
Posts: 14

sas ods pdf and gkpi

Hi all.

I have the need to put some gkpi output on a pdf, but I'm not able to make them the right size. After a certain dimension on the pdf, the graph remain the same size, and only the white border around increae. Is there something I can do? The code I use is something like the following. Thanks Smiley Happy

 

ods _all_ close;
ods escapechar="^"; 
ods graphics on / reset=all border=off MAXLEGENDAREA=50;
options orientation=PORTRAIT papersize=A3 /* 420x297 */
	topmargin=1cm bottommargin=1cm leftmargin=1.5cm rightmargin=0.5cm
	nodate center nonumber;

ODS PDF file="%quote(&outfilepath./&folder./&filenamedef..pdf)" color=yes style=customDmSintA3
STARTPAGE=no bookmarkgen=no dpi=150 nogtitle nogfootnote compress=9;

ods layout absolute y=5cm height=5.5cm;
    goptions reset=goptions hsize=4cm vsize=4cm noborder;

    ods region x=0cm width=9cm;
        proc gkpi mode=basic;
            dial actual=5 bounds=(1 10 15) /
                target=8 nolowboundary
                colors=(cx84AF5B cxD06959);
        run;
    ods region x=9cm width=9cm;
        proc gkpi mode=basic;
            dial actual=50 bounds=(1 60 90) /
                target=40 nolowboundary
                colors=(cx84AF5B cxD06959);
        run;
    ods region x=18cm width=9cm;
        proc gkpi mode=basic;
            dial actual=91 bounds=(1 180 270) /
                target=100 nolowboundary
                colors=(cx84AF5B cxD06959);
        run;
ods layout end;

ods pdf close;
Grand Advisor
Posts: 10,210

Re: sas ods pdf and gkpi

You may need to look at adjusting the height and width using the ODS graphics options:

 

ods graphics/ height=1in width=2in; or similar before each procedure call if you want different graphics sizes.

Occasional Contributor
Posts: 14

Re: sas ods pdf and gkpi

It seems that proc gkpi is not affected from those options Smiley Sad

Grand Advisor
Posts: 10,210

Re: sas ods pdf and gkpi

Try the xpixels and ypixels on goptions instead of hsize vsize.

Occasional Contributor
Posts: 14

Re: sas ods pdf and gkpi

xpixels and ypixels behave same of the vsize... If you go down in size, the output goes smaller. But if you increae the values, just the around square of the image increase, lefting the image itself the same size... -.-"

SAS Super FREQ
Posts: 8,719

Re: sas ods pdf and gkpi

Hi: PROC GKPI is not controlled by ODS GRAPHICS options, since it is a SAS/GRAPH procedure. So the suggestions to use GOPTIONS is a good one. You do not show your DEVICE= option, but the doc clearly explains that you need to use DEVICE=JAVAIMG, as shown in this example: https://support.sas.com/documentation/cdl/en/graphref/63022/HTML/default/viewer.htm#a003178224.htm

But ultimately, I think you may want to work with Tech Support on this question. All of the examples in the DOC are ODS HTML examples and if you are seeing behavior that is not acting in ODS PDF as you wish, then it might be because ODS PDF does not play nice with the way GKPI works.

cynthia
Ask a Question
Discussion stats
  • 5 replies
  • 530 views
  • 0 likes
  • 3 in conversation