Page 1 of 1

Issue with printing forms with leading subsummary

PostPosted: Thu Jan 21, 2021 4:05 pm
by ryan.m.beasley
Hello,
I have a form with a leading subsummary (see attachment).
It's being grouped by a foreign key that links all of the items in the body detail together. The body elements (which you can't see because I shrunk them down to one pixel and set them to enlarge horizontally if there are any elements) print out just fine when the form loads; however, oftentimes the subsummary is completely blank. This only occurs sporadically. On the same dataset at some point I'll print out the form and the subsummary will be fully populated, but then an hour later I'll print out the same data set and only the body details will printout, the subsummary will be completely blank for each set of items.

The on show is calling the controller.sort() method for the group by field. I'm kind of stumped here. Any ideas? I just don't understand why it works half the time. If it didn't work at all, I'd just rethink how to code it, but the fact that it's showing what it's supposed to be showing sporadically makes me wonder if there's some underlying issue in the servoy code.
Thanks,
Ryan Beasley

formexample.PNG
formexample.PNG (8.8 KiB) Viewed 2462 times

Re: Issue with printing forms with leading subsummary

PostPosted: Fri Jan 22, 2021 4:18 am
by sean
Hi Ryan,

Hard to know what is happening from this post. Is it possible that your foundset is not correctly sorted sometimes?
Calling it onShow might not be getting it. Can you call the sort before showPrintPreview() / print() ?

Re: Issue with printing forms with leading subsummary

PostPosted: Fri Jan 22, 2021 9:17 am
by ryan.m.beasley
I just set it up where I call it right before the controller.print() method and it the leading subsummary still isn't showing up.

forms.conmon_log_single.controller.loadRecords(dataset);
plugins.file.deleteFile('c:/temp/servoyFile.pdf');
forms.conmon_log_single.controller.sort("cci_conmon_relations_to_conmon_activities.completed_on asc");
forms.conmon_log_single.controller.print(false,false,plugins.pdf_output.getPDFPrinter('c:/temp/servoyFile.pdf'));
application.executeProgram('rundll32', ['url.dll,FileProtocolHandler', 'c:/temp/servoyFile.pdf']);

I added another attachment of the export to the post to show exactly what's happening.

Re: Issue with printing forms with leading subsummary

PostPosted: Thu Jan 28, 2021 9:45 pm
by ryan.m.beasley
So an update on this: I redeployed with the changes we had discussed. Using the two fields to group by and sort by still caused issues after I deployed; however, locally as we saw it was working. I removed the two fields to group by and just grouped by the primary key and sorted by only the primary key. It worked locally, but after deploying it still didn't work. I even restarted the server after. Still having issues with some things not showing up. I'm going to log the foundset.getsort method after my next deployment tonight to see if it's pulling the wrong sort from somewhere. I'll keep you posted.