Keeping objects from printing

Please have a look at chapter 11 of the Servoy developer user guide, paragraph one: ‘Keeping objects from printing’.

Not sure whether this one was aimed at my problem.

Can’t use the design time property, since I need to decided whether to print the lines on a customer-by-customer basis.

Setting visibility works fine, except for the one element which is placed in the body part. Running the script to hide the element in Developer 3.1.3 causes a nullpointer exception… when staying on one form, and preparing another form (with independent found set) for printing.

I am sorry to say we still can’t reproduce the problem. Please create a case in our support system, preferably with a sample solution that demonstrates the problem.
It is available through Servoy - Error.

Just to be sure: is it an expected behaviour that a method hiding or showing objects in a print form returns a nullPointerException if I don’t include a controller.Show before trying to set object’s visibility?

In my case, if I do:

	forms.offers_printing_form.controller.sort('progressivo asc')
	forms.offers_printing_form.controller.loadRecords(forms.offers_to_lineitems)
	forms.offers_printing_form.setupPrinting()
	forms.offers_printing_form.controller.showPrintPreview()

I get a nullPointer.
Instead, using:

	forms.offers_printing_form.controller.sort('progressivo asc')
	forms.offers_printing_form.controller.loadRecords(forms.offers_to_lineitems)
	forms.offers_printing_form.controller.show()
	forms.offers_printing_form.setupPrinting()
	forms.main.controller.show()
	forms.offers_printing_form.controller.showPrintPreview()

The objects are correctly shown or hidden.

the setupPrinting method only check a value in the offer and, depending on this value, it hides or shows elements in the printing form.

Riccardino:
Just to be sure: is it an expected behaviour that a method hiding or showing objects in a print form returns a nullPointerException if I don’t include a controller.Show before trying to set object’s visibility?

NullPointerExceptions surely never are expected behaviour in Servoy.

Would you please make a support case, stating what Servoy version, what Java version and what OS you are running. Preferably with a sample solution attached.

The Servoy support system can be reached at:
http://crm.servoy.com/servoy-webclient/ … oy_support