0
votes

I'm hoping someone would be able to help me with this problem. I am trying to make a report using proc report with ods pdf. The problem is when I use the page option with the intention of displaying the columns to the right on a new page, they appear right below the columns on the left on the same page instead of on a new page. Here is a sample code:

filename _pdf_ "&path.\_&sysdate9..pdf";
 ods pdf file=_pdf_ newfile=none startpage=no style=styles.Profile pdftoc=1 bookmarkgen/*notoc*//*Defined in Step 1 above*/;
ods pdf startpage=now;

proc report data=sashelp.cars(obs=10);
  column make model type origin drivetrain msrp invoice enginesize;
  define make/display style(column)=[width=4cm asis=on just=l] style(hdr)=[asis=on just=l];
    define model /display style(column)=[width=4cm asis=on just=l] style(hdr)=[asis=on just=l];
    define type / display style(column)=[width=8cm asis=on just=l] style(hdr)=[asis=on just=l];
    define origin / display style(column)=[width=5cm asis=on just=c] style(hdr)=[asis=on just=l];
    define drivetrain/display page style(column)=[width=4cm asis=on just=l] style(hdr)=[asis=on just=l];
    define msrp /display style(column)=[width=4cm asis=on just=l] style(hdr)=[asis=on just=l];
    define invoice / display style(column)=[width=8cm asis=on just=l] style(hdr)=[asis=on just=l];
    define enginesize / display style(column)=[width=5cm asis=on just=c] style(hdr)=[asis=on just=l];
 run;

ods pdf close;

My output is: enter image description here

The idea is to display drivetrain, msrp, invoice and engine size on a new page. I'm using sas 9.4. I have read the documentation in case I'm missing some option but can't seem to figure it out. Would appreciate any help.

1
Just running that PROC REPORT step in SAS/Studio generates two pages in PDF file. Did you try without the STARTPAGE= option?Tom
I tried your suggestion to the above piece of code and it worked fine some times but not all the time. However, when I tried it on my actual program I still had same problem. I figured it must be some options in my program but I tried everything and no change. I then removed both the 'startpage=no' and "ods pdf startpage=now;" and it worked fine. Only problem now is that the title which is generated using ods text statement is on a different page from the actual table.John Doe

1 Answers

0
votes

Couple of things:

  1. update the startpage=no to yes
  2. Adjust the width for type, origin, invoice, enginesize variables.. I set it to 4 and it ran fine