Bad print

Why my printing looks different then the form? I have a list view (or a table view), but the print lays the records one near the other rather then using rows.

To print, I use: controller.showPrintPreview(false);

Well, print always lays out records as repeated body parts (as they would show in record views).
If there is enough room to print records on the same row, it will do that. In your case the form width seems to be actually high so it shouldn’t have room to put more records on the same row…

I am guessing that “fld_description” and “fld_percent” are set to use print sliding - allow shrink in width (or height as well)… This means that the print record’s width will be relative to the content displayed in those fields. (so the form’s right boundary is actually X pixels away from the fld_percent’s right boundary, it is no longer fixed). Because those 2 fields have no data they will slide-shrink to nothingness so the form’s size shrinks as well, leaving room for the next record.

Am I right?

Try to set the body part’s background color for testing purposes to see the area actually occupied by each record and start changing properties.
Try to disable print sliding for those fields if you don’t need it, or only allow them to grow. If you need them to disappear when no data is present, just grow the form’s width so that there is more space between the combo’s right boundary and the form’s right boundary or add an empty slim wide printable label that won’t paint anything along the width of the two fields that might disappear.

Hi thanks a lot for the response. As you can see, the list view is printing correctly now. But that list is embedded into another form. I’m interested in printing the parent form, the other print was only for testing. The problem is that for the parent form, the items in the list don’t appear at all. It prints only the Title Header part.

You can see at the bottom of the image the list form printed correctly, but on the left side is the printing of the parent which should contain also the exactly 2 rows.

What can be the problem here?

Are you using a tab-panel? Tab panels are not printable by default.
Also tab-panels will print just like images do (for example in case of many records in the tab-panel, a page break might actually split text in two). Forms in tab-panels will also ignore print sliding when printing. This is the reason why they are not printable by default. But you can make them printable if you want to and try it out.

Servoy printing was optimized for one-form printing. If you want more complex printing try the jasper reports plugin.

That form contains only 2 tabpanels. One with the record view at the top, with all those fields, and the second is the list at the bottom… ok, I’ll see… Thanks a lot!