The SAS Output Delivery System and reporting techniques

ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 11
Accepted Solution

ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

I keep am able to run the exact same program in Base SAS and Enterprise Guide to produce a PDF document with a table of contents. However, in Base SAS I get a printable table of contents, but in Enterprise Guide the final PDF does not contain a printable table of contents. Everything else about the files looks the exact same, except the printable table of contents is in the PDF file generated from Base SAS and not in the PDF generated from Enterprise Guide. 

 

I have been researching this for a couple days and tried several different options and I haven't been able to find a solution. Appreciate any help! 

 

 

 

options nodate;

run;

ods pdf file="filepath.pdf" startpage=no contents=yes uniform;

 

%macro cat (pred,i,tlb,);

ods proclabel="&tlb";

ods trace on;

proc tabulate data=new2 f=10.2 S=[foreground=black background=white just=c font_size=3.75] ;

       class &pred/preloadfmt order=data;

       classlev &pred/s=[foreground=black background=bwh font_size = 3.75];

       table &pred=' ' all={label="All" s=[just=L foreground=black background=bwh font_size=3.75]},(n*f=8. colpctn*f=mypct.)/box=[label="&tlb"   

               style=[background=beige

                      foreground=black font_size = 3.75 width=60%]]  row=float printmiss contents="&tlb";

       keyword n colpctn/style=[background=beige  foreground=black font_size=3.75] ;

       keylabel n="Freq" colpctn="%";

run;

%mend cat;

%cat (dem1,1,var1);

%cat (dem2,2,var2);

%cat (dem3,3,var3);

%cat (dem4,4,var4);

%cat (dem5,5,var5);

ods pdf close;


Accepted Solutions
Solution
‎10-16-2017 11:27 AM
SAS Super FREQ
Posts: 9,254

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

[ Edited ]

Hi:
It's not the style. It is something related to this Tech Support note: http://support.sas.com/kb/56/041.html -- where the PRINTERPATH needs to be set to PDF BEFORE the code that generates the ODS PDF file.

I was able to replicate the issue in EG with simpler code and once I added
options printerpath=pdf;

The Table of Contents page was generated for PDF.

Cynthia

View solution in original post


All Replies
Super User
Posts: 13,008

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

Posted in reply to jessica_hale

Can you show the entire base program that worked from the ODS PDF statement to the ODS PDF Close?

 

And by any chance is your Enterprise Guide running on a server? The ODS Style might vary from your Base SAS causing an issue.

Occasional Contributor
Posts: 11

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

Hi ballardw, 

Is this what you were needing? 

 

ods pdf file="filepath.pdf" startpage=no contents=yes uniform;

 

%macro cat (pred,i,tlb,);

ods proclabel="&tlb";

ods trace on;

proc tabulate data=new2 f=10.2 S=[foreground=black background=white just=c font_size=3.75] ;

       class &pred/preloadfmt order=data;

       classlev &pred/s=[foreground=black background=bwh font_size = 3.75];

       table &pred=' ' all={label="All" s=[just=L foreground=black background=bwh font_size=3.75]},(n*f=8. colpctn*f=mypct.)/box=[label="&tlb"   

               style=[background=beige

                      foreground=black font_size = 3.75 width=60%]]  row=float printmiss contents="&tlb";

       keyword n colpctn/style=[background=beige  foreground=black font_size=3.75] ;

       keylabel n="Freq" colpctn="%";

run;

%mend cat;

%cat (dem1,1,var1);

%cat (dem2,2,var2);

%cat (dem3,3,var3);

%cat (dem4,4,var4);

%cat (dem5,5,var5);

ods pdf close;

Super User
Posts: 13,008

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

Posted in reply to jessica_hale

This might be an issue with some difference in the way EG uses the default PDF style. Try adding a specific style to the ODS PDF statement such as: Style=Styles.HtmlBlue

This will likely change a number of appearance options but if the TOC prints then we know its a style issue.

 

But again. is your EG running on a server or local?

Solution
‎10-16-2017 11:27 AM
SAS Super FREQ
Posts: 9,254

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

[ Edited ]

Hi:
It's not the style. It is something related to this Tech Support note: http://support.sas.com/kb/56/041.html -- where the PRINTERPATH needs to be set to PDF BEFORE the code that generates the ODS PDF file.

I was able to replicate the issue in EG with simpler code and once I added
options printerpath=pdf;

The Table of Contents page was generated for PDF.

Cynthia

Occasional Contributor
Posts: 11

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

Posted in reply to Cynthia_sas
Thank you! This worked perfect.
Occasional Contributor
Posts: 11

Re: ODS PDF TOC - Not producing printable TOC in Enterprise Guide, but does in Base SAS

I believe it is local.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 367 views
  • 0 likes
  • 3 in conversation