In Filemaker, you can do this for when you print, preview or save as PDF. Take a look at the sliding and visibility section on the Inspector's position tab.
However, I'd consider making the grade fields separate related records, in which case your empty fields become non-existant related records and portals or list views will automatically list only those related "grade" records that actually exist.
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.
- Container fields will slide only if Top, Left alignment is specified for it in the data formatting section of the Inspector's data tab.
- Consistent side borders are difficult to achieve with sliding fields.