If you select the portal and set it to "slide up" and also select "resize enclosing part" the portal should shrink when you print, Preview or PDF from that layout. But often, it's better to switch to a layout based on the portal's table with fields from the parent record included in header, footer and/or a grand summary layout part. You can perform a find or go to related records to produce a found set of just those portal records linked to the parent record that was current at the time you clicked a button to perform this script.
Such a layout is more flexible than a portal set to slide/resize as it cand expand to multiple pages as well as shrink and fields that are part of the portal's record can slide/resize where in a portal you can only slide/resize to reduce the number of unused protal rows.
Key facts about sliding layout objects:
- It's only visible in preview mode and when you print/save as PDF...
- All layout objects below and in the same layout part as the slide/resize field need to also be set to slide up and resize.
- Objects in headers and footers will not slide.
- Portals will shrink/slide to fit the number of rows of records, but fields within the portal row will not shrink/slide.
- Fields will slide up only if Top, alignment is specified for it and will slide left only if left alignment is specified.
- Consistent side borders are difficult to achieve with sliding fields.