Issue with printing forms with leading subsummary

Discuss all problems you have with Servoy here. It might help to mention the Servoy version and Operating System version you are using

Issue with printing forms with leading subsummary

Postby ryan.m.beasley » Thu Jan 21, 2021 4:05 pm

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 2466 times
Attachments
servoyFile.pdf
(3.64 KiB) Downloaded 141 times
Last edited by ryan.m.beasley on Fri Jan 22, 2021 9:18 am, edited 2 times in total.
ryan.m.beasley
 
Posts: 61
Joined: Wed Oct 10, 2018 8:51 pm

Re: Issue with printing forms with leading subsummary

Postby sean » Fri Jan 22, 2021 4:18 am

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() ?
Software Engineer
Servoy USA
sean
 
Posts: 370
Joined: Mon May 21, 2007 6:26 pm
Location: USA

Re: Issue with printing forms with leading subsummary

Postby ryan.m.beasley » Fri Jan 22, 2021 9:17 am

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.
ryan.m.beasley
 
Posts: 61
Joined: Wed Oct 10, 2018 8:51 pm

Re: Issue with printing forms with leading subsummary

Postby ryan.m.beasley » Thu Jan 28, 2021 9:45 pm

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.
ryan.m.beasley
 
Posts: 61
Joined: Wed Oct 10, 2018 8:51 pm


Return to Discuss possible Issues and Bugs

Who is online

Users browsing this forum: No registered users and 4 guests