5 Replies Latest reply on Apr 27, 2015 8:39 AM by fmnoob

    Sub Summary Report

    fmnoob

      Title

      Sub Summary Report

      Post

      FM Pro 13

      Parent table; Child table

      I created a sub summary report that summarizes the data in the child table for each parent record and has a total by a category field in the child records and a total for the parent. This works from a script and works when displaying info for all Parent records.

      I want to use the same report to show records from just 1 parent record and am unable to create a script that will limit the report to just the 1 parent.

      Can someone please point me in the right direction, I am a newbe to FM and trying to work with the scripting language.

      Thanks,

        • 1. Re: Sub Summary Report
          TKnTexas

          Create a script that can be run from the parent table.  

          Single script step:  Go to Related Records.  You designate the table and layout you want.  

          In the Parent table find the one item you want.  Then execute the script.  That is simplistic. 

          You can also do a find on the parent record as a foreign key directly from the child record.   

          • 2. Re: Sub Summary Report
            fmnoob

            If I wanted to just display the related child records your solution would work, but I am attempting to script a sub summary report that only displays the child records of one parent.

            Parent = Trip

            Child = TripExpense

            The sub summary report has a TripName leading sub summary; ExpenseCategory leading sub summary; body of several TripExpense fields; a ExpenseCategory trailing sub summary; a TripName trailing sub summary.

            The script:

            Go to Layout ["TripExpenseReport" (TripExpense)]

            Sort Records [Restore; No Dialog] // sorts on the TripName and ExpenseCategory fields.

            This all works if I want all Trips.

            I want to limit the report to a selected Trip, with a scripted button on the parent record.

            • 3. Re: Sub Summary Report
              philmodjunk

              If I wanted to just display the related child records your solution would work, but I am attempting to script a sub summary report that only displays the child records of one parent.

              Go To Related Records (GTRR) will produce a found set of just the related child records for the parent record that was current at the time the GTRR step was executed. This is exactly what you have asked for.

              You can also capture the value of the parent record's ID in a variable, change layouts and use the value in that variable to find the child records, but this produces exactly the same result as using the single GTRR step.

              • 4. Re: Sub Summary Report
                TKnTexas
                • 5. Re: Sub Summary Report
                  fmnoob

                  Thanks to both for your patience, I now see that what you suggested does do the job.smiley