We have a form for a Monthly Customer Statement, showing all the stuff bought. This is printed on headed, perforated paper. Some customers prefer receiving their statements via email, so we use Servoy to send out emails with PDFs (the perforation shown as a dotted line).
We use one form for both versions of the statement. We have named all the elements we want to hide on the paper version. There is a simple script which runs through the list of elements and shows or hides them, something like this:
var vis = arguments[0];
elements.line1.visible = vis;
elements.line2.visible = vis;
If we try to hide an element in the body part of the form, we get a null-pointer exception in Servoy Developer 3.1.3, unless we have displayed the form manually on screen before trying to print.
We can access the offending element via the debugger… but not in a script…