Printing HTML report

Hi,

I’ve an html report in a global field that is presented in a dialog. The dialog has a Title Header part and a body part.

The title header part has one print button.
The global field occupies all the available space in the body.

I’ve tried without success to print the report both to file and printer with
controller.showPrintPreview() and with controller.print().

The best I’ve managed is to have the header printed on paper.

Any pointers in how to achieve this?

Txs,
Miguel

Hi Miguel,

Do you build the HTML before you go to printpreview?

ROCLASI:
Do you build the HTML before you go to printpreview?

Sure Robert,

The HTML is built and displayed on a global field taking the entire form body. On the form header I have a button calling the printpreview.

Miguel

Hi Miguel,

Is the “Printable” property checked of this HTML field?

Upps!

Ok. Now I it’s on!

But I’m still in trouble.
I’m using an HTML_AREA with a global field, so I set printSliding to grow on height (I read the docs, just grow on height ;-) and the code is:

controller.showPrintPreview(true);

Now it shows in printPreview, but I can’t manage to print it. The informative error message from Servoy is:

"Cannot print document

-1"

The first time I run it. If I run it immediately after the first run I get a printout of the first page of the report. But no more!

What am I missing?

Best,
Miguel

mjekl:
Upps!
What am I missing?

Who would guess :twisted:
Checking allowBreakAcrossPageBounds property of the body form part!

Case closed!
Miguel