Printing an extra page

Hi,

In the solution I am developing there is form that contains invoiced items, form which will be printed. There is a header, a body and a footer as form parts. At printing time there are many pages, when the items do not fit in one page and this is the desired behavior.

I also need to add a new page at the end of the invoice, which is the licence agreement. How can I get it printed at the end of the invoice?

You may be asking for something fancy with parts, but I’m not sure. Anyway, since your license agreement it is a new page, just create another form for it and have it print after each invoice using a second print statement in a special printInvoices method you set up just for this purpose. If it is a batch of invoices, loop through each one changing the foundset and printing the license agreement after each invoice.

This was also my idea, but I need to show a print preview of the invoice. I do not know how to set the page setup using a method.

controller.showPrintPreview() will show the form in preview mode.

create another form for it and have it print after each invoice using a second print statement in a special printInvoices method you set up just for this purpose

I cannot do this, since I am displaying a print preview and I cannot trace if the user has printed or cancelled. So I do not know when to print the second form.

It should be something with the form parts, but I cannot figure it out…

Okay, now I see. What you can do is set up the print invoice method to show the first preview of the invoice form then in the same script, have a call to show the second form then in preview mode. That way when you print or close preview, the next form will show in preview mode.

forms.invoice.controller.showPrintPreview();
forms.license.controller.show();
forms.license.controller.showPrintPreview()

Only hitch with this is that when you click ‘close’ on the first preview you will still get the second one. I don’t know of a way to trap for closed preview as preview is a different mode rather than a different form. However, having that ability would be a very nice feature.

sabeenah:

create another form for it and have it print after each invoice using a second print statement in a special printInvoices method you set up just for this purpose

I cannot do this, since I am displaying a print preview and I cannot trace if the user has printed or cancelled. So I do not know when to print the second form.

It should be something with the form parts, but I cannot figure it out…

Just add another part of type “Trailing Grand Summary” and put your stuff there, if I remember correctly this does print only at the end and is not repeated in any page as a footer part is.

That is correct, trailing grand summary will accomplish what you want.