4 Replies Latest reply on May 29, 2012 8:40 AM by otto_m

    sequential numbering of summarised records

    otto_m

      Title

      sequential numbering of summarised records

      Post

      Hi,

      I have the following tables:

      <students> with data such as name, class etc.
      <problems> with exam questions, PROB#
      <exam> links via STUD-ID with <students> and via PROB# with problems.

      I have created a layout to list the exam questions for each class for a certain exam date:
      Sub-summary by <students::class>
      Body containing the <problems::exam question> field

      This works fine, and the print view lists all exam problems for each class in alphabetical order. The icing of the cake, however, would be a sequential number for the questions that restarts with each class.

      I have looked around the forums and FM help, but none of the solutions works. Is there a simple solution?

      Thanks for your help,

      Otto

       

        • 1. Re: sequential numbering of summarised records
          philmodjunk

          "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.)

          • 2. Re: sequential numbering of summarised records
            otto_m

            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?

             

            • 3. Re: sequential numbering of summarised records
              philmodjunk

              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.)

              • 4. Re: sequential numbering of summarised records
                otto_m

                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.

                Thanks again,

                Otto