ODS and Base Reporting

Build reports by using ODS to create HTML, PDF, RTF, Excel, text reports and more!
BookmarkSubscribeRSS Feed
zhangda
Fluorite | Level 6

Hello all!

 

I am coding a book cover and a table of contents with ods pdf file, but why there is a small box on the top writing' Continuing contents of page 2, which would not fit on a single physical page' appearing on the second page next to book cover page? How could I remove it?

 

Thank you so much!

 

My code is as below,


ods pdf file="/C/test3.pdf" notoc;


title1 j=c color=black HEIGHT=150pt BOLD " ";


title2 j=c color=black HEIGHT=35pt BOLD "Apido Company ";

title3 j=c color=black HEIGHT=35pt BOLD " Month End Reporting Package ";
title4 j=c color=black HEIGHT=280pt BOLD " ";

title5 j=c color=black HEIGHT=18pt BOLD "Data as of &yesterday. ";

title6 j=c color=black HEIGHT=148pt BOLD " ";
title7 j=left color=black HEIGHT=26pt BOLD "";

/* Workaround code starts here */
ods pdf startpage=now;

proc report nowd data=sashelp.class(obs=1)
noheader style(report)={rules=none frame=void}
style(column)={foreground=white};
run;

ods pdf startpage=no;

ods pdf text = '^S={ foreground=black fontweight=bold just=left font_size=28pt} Table of Contents';
ods pdf text = '^S={ foreground=black fontweight=bold just=left font_size=28pt} ';
ods pdf text = '^S={ foreground=black fontweight=bold just=left font_size=16pt} CQ Metrics ...........................................................................Page 2';


ods pdf close;

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

I tend to put page breaks specifically in the data and break on those rather than leaving default behaviour.  If you data is simple then you can just do:

data have;
  set have;
  pge=floor(_n_ / <numobsperpage>) + 1;
run;

proc report ...
  define pge / order noprint;
  break on pge / page;
run;

Obviously if your data is more complex then the page calculation will mirror this.

zhangda
Fluorite | Level 6

Hi, 

 

Would you please give me the specific code? because I cannot run your code successfully, lots of errors. Thanks!

RW9
Diamond | Level 26 RW9
Diamond | Level 26

This is an only and example showing a couple of the lines needed (i.e. the datastep algorithm to derive a variable called pge and the additional lines for the proc report step).  You will need to modify to fit your process.  

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2203 views
  • 0 likes
  • 2 in conversation