controller.print() how to

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

controller.print() how to

Postby Bernd.N » Fri Apr 01, 2016 2:06 pm

I tried to print a table form with
Code: Select all
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?
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany

Re: controller.print() how to

Postby Andrei Costescu » Fri Apr 01, 2016 5:00 pm

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".
Andrei Costescu
Servoy
Andrei Costescu
 
Posts: 1018
Joined: Tue Jun 26, 2007 3:14 pm

Re: controller.print() how to

Postby Bernd.N » Fri Apr 01, 2016 5:16 pm

Thanks for your fast answer, Andrei!
Bernd Korthaus
LinkedIn
Servoy 7.4.9 SC postgreSQL 9.4.11 Windows 10 Pro
User avatar
Bernd.N
 
Posts: 544
Joined: Mon Oct 21, 2013 5:57 pm
Location: Langenhorn, North Friesland, Germany


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 7 guests

cron