I would like a form that shows all parent and child records in an easy to read format that can be printed or opened in PDF. Let’s say my two tables are “States” and “Cities”. I would like for the form to look like this.
Alabama
Birmingham
Montgomery
Mobile
Huntsville
Arkansas
Conway
Fort Smith
Arizona
Goodyear
I can do this with tabpanels, but since each state will have a different number of city records, and since Print Sliding apparently doesn’t work on tab panels, there would be large gaps of dead space on some pages.
Currently I have a form in List View based on the Cities table. I can put the State name in the header, but all the cities print out under one state. How can I show all States and all related cities? (I’ve tried to download Jasper Reports and Velocity but both were over my head so I’m trying to do this the simplest way within Servoy).
thanks!
Hi Wes,
the way to do this, is to create a print layout based on the city table.
Then have a sub summary band containing the related state.
Before printing you should sort the city table on state(id) in order to have all cities printed by state.
thanks for the reply. Based on that, I created a form in List view based on cities (datasouce: city). I added a Header, Leading Subsummary, and Body. On the onShow command for the form I added
controller.sort(state_id)
For the Leading Subsummary, on the Parts tab, I added a Group-By field as state_id. I wasn’t sure whether this should be “state_id” from the city table, or the related field from the state table “city_to_state.state_id”. I tried it both ways.
On the form, in the Leading Subsummary band I added the field state_id and the related field city_to_state.state_name.
In the body I added city_name.
The result is I see all the city names listed together and don’t see any state names, or anything else from the subsummary band displayed on the form or in the Print Preview. Where did I go wrong?
thank you!
I think I found my mistake. The sort should have been
controller.sort('state_id')
I’m now seeing the desired result. thank you!