The SAS Output Delivery System and reporting techniques

ODS PDF, CSS Styles, and Page breaks

Reply
Super Contributor
Posts: 250

ODS PDF, CSS Styles, and Page breaks

I know that prior to 9.4, it was not possible to ask Proc Report to automatically determine page breaks AND to do something with that (such as placing "Continued..." after each page break before the last page).

I'm curious if there's a way to do that now, using CSS styles and some combination of nth-child or similar type references, to identify that some style should be applied either to the last page only or to every other page (for example, footnotes having white background black text for all pages except the last, white text for last page's footnotes).  I can't think of a good way to do it, but imagine it might be possible.  (However, given that I don't think last-child is supported in SAS/CSS, perhaps that's not true.)

Or, if there's another way to get what I want, please let me know (for now I'm doing the clunky guessing how many rows fit on a page method).  In this case, I have a report that has some lines wrapping, so it's fairly difficult to determine exactly how many lines work per page - and on top of that, it's not very future-proof if things like page size, margins, font size, etc. change in my report.

Thanks!

SAS Super FREQ
Posts: 8,815

Re: ODS PDF, CSS Styles, and Page breaks

Hi:

  Starting a few versions ago, PDF does support CSS style sheets through the use of the CSSSTYLE= option (yes, there are 3 "S" in the option).

  But I do not know enough about CSS and the @MEDIA for PRINT vs SCREEN to know whether you can apply a style like that to the PDF output pages. That would be a question for Tech Support.

  For a general introduction to the use of CSSSTYLE, this paper may offer some insight -- http://support.sas.com/resources/papers/proceedings09/014-2009.pdf -- but not to the level of detail you describe. There is a very, very simple example of the @MEDIA rule usage in the paper.

cynthia

Super Contributor
Posts: 250

Re: ODS PDF, CSS Styles, and Page breaks

Thanks, Cynthia.  I ended up doing it the hard way, deciding where to break pages on my own and breaking on those variables, but if I have time in the future I'll talk to tech support.  I was indeed using CSSSTYLE in the ODS PDF, and am a big fan of such.

Ask a Question
Discussion stats
  • 2 replies
  • 482 views
  • 3 likes
  • 2 in conversation