BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jerry898969
Pyrite | Level 9

I have a task to create a pdf report.  I have the report generating but I have some table headings on the last line of one page and the data on the next page.

Is there a way to check how many lines are left on a page and if it's not enough add a new page at that point?

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

It may help to show the code you use to generate the report including any options on the ODS PDF statement and system options like papersize, orientation and such.

 

The basic answer to "knowing rows" is "not likely to happen".

Reasons: Font size affects amount of space used for each "row" of output. The amount of cellpadding top and bottom affects size of each row.

Paper size affects the amount of space available.

Options in styles or code for Titles, Footnotes affect the amount of space each takes. If one of the wraps due to page width then another complication.

 

The way you create a report may allow you to control where pages break nicer but there isn't going to be any simple magic bullet.

View solution in original post

2 REPLIES 2
ballardw
Super User

It may help to show the code you use to generate the report including any options on the ODS PDF statement and system options like papersize, orientation and such.

 

The basic answer to "knowing rows" is "not likely to happen".

Reasons: Font size affects amount of space used for each "row" of output. The amount of cellpadding top and bottom affects size of each row.

Paper size affects the amount of space available.

Options in styles or code for Titles, Footnotes affect the amount of space each takes. If one of the wraps due to page width then another complication.

 

The way you create a report may allow you to control where pages break nicer but there isn't going to be any simple magic bullet.

Jianmin
Obsidian | Level 7

Hi @jerry898969 and @ballardw , 

 

I really appreciate jerry898969's question and ballardw's effort to solve the problems.  Like in ballardw's response the current implementation of RTF in PROC REPORT would not solve these problems. So, it's a matter of a different implementation of RTF that could potentially solve the problems.   Attached is an example of such an implementation, it was created as an RTF file and it's saved as a Word document.  See it for yourselves.  There is no page break in this file. The Microsoft Word/RTF handles pagination very well, and you will never count lines on a page. 

 

Jianmin Long

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2 replies
  • 1774 views
  • 1 like
  • 3 in conversation