PDF Spaces between records of a nested grid

Good morning. I am attaching an image. Basically I have a grid grafted into another through a subquery. the problem occurs when I export the pdf. it creates spaces between the records of the nested grid that are not there when I view it without exporting it.

Moreover, I gave the nested grid a completely different style (colors, fonts) from the one it assumes when it is inserted as nested of the main grid, as if the master grid style overrules the nested grid style (but this is another problem)

Instead, I would like first of all to under

stand how to solve the problem of spaces for a better layout.

Thank you