Calculated fields not rendering in print(-preview)

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.

Any suggestions?

Thanks,
Neale.

so you are saying that the data is always correctly shown on the forms (non printing)
But in printing it doesn’t show?

What kind of view are you in?
Is that a tableview/portal where the calcs are missing?

jcompagner:
so you are saying that the data is always correctly shown on the forms (non printing)
But in printing it doesn’t show?

Yes (more specifically: sometimes it shows, but mostly not).

jcompagner:
What kind of view are you in?
Is that a tableview/portal where the calcs are missing?

Just a regular record-view.

FWIW, it sounds like idoctor and I have the same issue Calculations and printing. - Classic Servoy - Servoy Community

Thanks,
Neale.

Hmm if you use record view then it is really odd. (tableview or a portal i could maybe explain)

Do you use modules?

And example (as jan blok asked in the other thread) would be very helpfull.

Nope, no modules.

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).

See 4th record on form ccards in http://www.lowendale.com.au/~neale/temp/cctest-r06.zip

Neale.

Oops, shouldn’t attempt these things too late on a Friday night.

Here’s an export WITH data: http://www.lowendale.com.au/~neale/temp … r06p01.zip

Neale.

Any chance of a status update on this (e.g. Was the example sufficient?; ETA for a patch?) - it’s biting :-(

Thanks,
Neale.

A few further observations:

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 :evil:
Obviously, this is causing us some significant pain right now :-(

HTH,
Neale.

Will be corrected(workarround Java 1.5 bug) in Servoy 2.2.2 (expected next week)

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 :-(

Any ideas for a workaround would be appreciated.

Thanks,
Neale.

Yes, me too, also with the latest version, the print-out is still NOT good with java 1.5 (1.4.x is fine!)

I have allready posted this to Jan B., and I hope he can fix it.

Any update on this one?

Thanks,
Neale.

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.

HTH,
Neale.

Are you printing to PDF(via plugin) or directly to printer?

Printing directly to printer.

We appear to be able to reliably workaround this by making the calc fields transparent AND using a method to walk the foundset and print one-by-one.

HTH,
Neale.