"none of the solutions work" doesn't tell us which ones you tried and how they failed for you. Thus, what I am suggesting may be a solution that you have already tried...
I am guessing that your report layout is based on the exam table...
Define a field, ClassID, in Exam that will return the Students::class value: It can be a looked up value field or a calculation field.
Define a summary field in exam as a "count of" summary field. Select Exam::STUD-ID or any other field that is never blank as the field that it counts. Select the running count option and also the restart count with each group. Specify the new ClassID field as the Grouop By field.
Modify your layout design so that the sub summary specifies ClassID as it's sort by field and sort your records by this new field. (Either that, or keep the layout unchanged and include both fields in the sort order.)
Thank you for your quick reply, and sorry for not being specific. The reason why it never worked was that I got the sort order wrong.
Another totally unrelated formatting question:
I have text fields in the body that are vertically centred, showing data from another field, e.g. "Bart", "Simpson".
If (IsEmpty (students::fname) ; "First Name:" ; students::fname)
However, in some cases the data fields are empty, so the printed form should have text such as "First Name"
in 9-point Helvetica and top aligned
to allow manual entry of the actual name in the form.
Are there commands to change alignment, and how do I include them in the calculation above?
First, a correction in my last post. After doing some checking, it does not appear necessary to add a field for the class in your exam join table. Instead, you can specify the original Students::class field as the group by field for your counting summary field.
In help, I find TextStyleAdd--which can allow you to specify 9 pt Helvetica, but not to alter the text alignment--which is a property on the field rather than the data in the field.
You might consider putting layout text behind or on top of the field positioned and styled the way you want and then use conditional formatting to keep it from being visible when there is data in the fname field. (If you use a conditional format to change th font size of layout text to 500, the text will disappear.)
Thank you for your hints on formatting, much appreciated:-)
As to the correction of your initial post, I tried it, but could not get the numbering to restart with each class. If I sort the leading summary using the ClassID, the numbering works perfectly.