controller.print() how to

I tried to print a table form with

forms.frm_trip_cost_types_tbl.controller.print(false, true);

The table would fit on one A4 page, however I got 27 PDF pages.

Is there a way to tell controller.print() that it should print everything on one page?

In printing you have a record view who’s body is repeated once for each record. It is not meant for tableview although if you have a tabpanel with a tableview it will render as a tableview - but it wont know where it can do page breaks nicely so it might end up cutting your text.

So printing works in a way similar to list view.

Design your print form so that the body has the height that one record should occupy on the page, and the width is low enough to fit on one page.
Then you can play with “defaultPageFormat” property of the form (adjust margins/portrait/landscape/size) and “paperPrintScale”.

Thanks for your fast answer, Andrei!