chadski021 Posted October 6, 2017 Posted October 6, 2017 (edited) How to show the record number in a sub-summary layout? It should start at record 1 per group, the parts of the layout are header, sub summary and body, It should look like this Group A 1 John Doe 2 Jane Doe Group B 1 John Doe 2 Jane Doe Edited October 6, 2017 by chadski021
rwoods Posted October 6, 2017 Posted October 6, 2017 (edited) Thats a tricky one. You may have to sort the records, then loop through them setting the number field (1, 2, 3 etc) before finally displaying your layout. Something like this. I'm calling the number field (1 , 2 , 3 etc) myTable::index Sort Records [on the sub-summary field] Go To Record/Request/Page [First] Set Field [ myTable::index ; 1] If ( Get ( FoundCount ) > 1 Set Variable [ $index ; 2 ] Set Variable [$currentGroup , myTable::GroupName] Go To Record/Request/Page [Next] Loop If [ myTable::GroupName = $currentGroup ] Set Field [ myTable::index ; $index ] Set Variable [ $index ; $index + 1 ] else Set Variable [$currentGroup , myTable::GroupName] Set Field [ myTable::index ; 1] Set Variable [ $index ; 2 ] End If Go To Record/Request/Page [Next ; Exit after last] End Loop else // there was only one record in the found set so do nothing end if Edited October 6, 2017 by rwoods
comment Posted October 6, 2017 Posted October 6, 2017 6 hours ago, chadski021 said: How to show the record number in a sub-summary layout? It should start at record 1 per group, Use a summary field defined as Count of [any field that cannot be empty], Running count, Restart summary for each sorted group. 1 hour ago, rwoods said: You may have to sort the records, then loop through them setting the number field That would create a conflict when two users want to produce different reports.
rwoods Posted October 6, 2017 Posted October 6, 2017 Ah yes, comment got the right answer, mine was both long winded and not safe for multi-users!
Recommended Posts
This topic is 2960 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now