I have a form to which I added some calculated fields, but the fields are sometimes not rendering in print(-preview).
Initially this was with Servoy 2.2.0 client and developer and was suspected to be related to a fix in 2.2.1: “Calcs using (related) aggregates did not always correctly update”. But with developer the problem persists with 2.2.1.
More specifically, the essential detail is that the form is an invoice form which has an opening balance field and related payment records. The calculation is the opening balance less the sum of the related payments (i.e. a sub-total) like:
return oBal - inv_to_pay.payAmtSum;
The (correct) values appear in the form and then may appear in print-preview (it’s not consistent) and then will mostly not appear in the printed output.
I think I’ve isolated it: a field with dataprovider which is a calc AND that field has been moved vertically (e.g. by the growth of an expanded portal).
Print preview doesn’t always agree with print output
On my test/demo solution, it’s not necessary for the calc field to be moved by way of printSliding - just that the portal has grown via printSliding
On my real solution, removal of printSliding properties from all portals, fields and labels hasn’t helped
Obviously, this is causing us some significant pain right now
Unfortunately, I’m still seeing this behaviour with Developer 2.2.2 build 334, with Java versions 1.4.2_03-b02(linux) and 1.5.0-b64(linux).
Making the calc field transparent doesn’t seem to help now
A further curious observation: the first page of a print(-preview) doesn’t appear to be afflicted by this bug (save for an obscure string of events including developer going to edit mode after which this bug appears rampantly in data mode too).
Which gives rise to a possible hack to workaround it: a method to loop through the foundset and separately print each record to the default printer. Ugly, but might get us out of trouble.