8 Replies Latest reply on Aug 10, 2012 8:23 PM by MichaelWeisenberg

    Selecting a set of records through a Portal

    MichaelWeisenberg

      Title

      Selecting a set of records through a Portal

      Post

      I have setup a series of tables in a College Academic Gradebook application in which I want to report on a student's final grades for multiple classes. In my application, I have separate tables fpr Students, Classes and Grade Input. Thus far, I have successfully completed my layout for the report which shows the student's final grades for a given class. I am trying to filter my report to only include the students for one of my classes at a time. To do so, I have added a Portal to my class table on my Final Grading Report Layout. After doing so, my grading report does list each student in multiple classes but my portal drop down only lists one of my classes at a time. What I would want to do would be to use the Portal to choose the class I want to filter for and have the report then only list students for this class. Is this possible to do in the manner I am attempting? What I have been able to do is to filter my report table to only include students for a particular class and then my report successfully displays only those students. While this is a workaround for me, I would rather use the Portal drop down to choose my class and have the report filtered by my choice. Can someone point me in the right direction? Thanks for your help!

      michaelxjw

        • 1. Re: Selecting a set of records through a Portal
          philmodjunk

          Why is the drop down in a portal? I'm just not getting the complete picture of your layout.

          When you do this: What I have been able to do is to filter my report table to only include students for a particular class.

          Are you performing a find?

          Finds can be scripted and can be setup to use data entered/selected by the user such as selecting a value from a value list.

          If the field where you selected the value has global storage, you can use a script like this:

          Go to Layout [Report layout]
          Enter find mode [] //clear the pause
          Set field [ATable::classID ; Globals::ClassID]
          Set Error Capture [on]
          Perform Find[]

          Globals::classId is my name for the filed formatted with the drop down.

          If the field is not a global field, you'd make this small adjustment:

          Set variable [$ClassID ; YourTable::ClassID ]
          Go to Layout [Report layout]
          Enter find mode [] //clear the pause
          Set field [ATable::classID ; $ClassID ]
          Set Error Capture [on]
          Perform Find[]

          • 2. Re: Selecting a set of records through a Portal
            MichaelWeisenberg

            Phil,

            Thanks for your input. By the use of the term "drop down" in my portal, I meant that I expected my portal to display all the record choices I had entered in my related table. Since the table in my portal refers to my "class" table & I have each of my classes entered as a record in my class table, I expected my portal to display each of my classes in a "drop down" ... I engaged the "drop down arrow" as an option for my portal. What actually occurs is my portal only shows the class entry for the record that is active on my report. The report including my portal does show all my records and does show a student grade record for each of my students and for each of my classes. What I had hoped for was to be able to choose my selected class from the portal drop down (as described above) since each of my clsses represents a separate record in my portal table and use that as a filter for my report. From what you are saying above, perhaps my portal is working as expected and the only workaround is to filter my report records by class through a "Find" as I described in my earlier posting. If that is the case, I can then explore the scripting you recommend above. Please confirm that it is expected in Filemaker Pro that a Portal cannot be used to filter your records as I had outlined above. If that is the case, I will then explore using a "Find" routine by "Class" and then use your recommended scripting routine as the next best alternative. Thanks for your help!

             

            michaelxjw

            • 3. Re: Selecting a set of records through a Portal
              philmodjunk

              I believe that you are describing a drop down list, not a portal. A portal is a "mini layout" that displays records from a related table and is added to your layout with the portal tool. A portal does not have a "drop down arrow". That is a feature of a drop down list.

              The confusion of terms makes it hard to understand what you are describing.

              It should be quite possible to setup either a portal that lists your choices as rows in a portal or a value list for a drop down that lists your choices in a drop down list. Either way, the script examples that I posted earlier can be set up to use either the row clicked in a portal or a value selected from a value list to perform a find for the records you want to include in your report.

              But the details on how to do that are not something I can describe from what you have posted so far in this thread. I'd need to have a much clearer and more detailed understanding of the structure of your report and the layout for it.

              • 4. Re: Selecting a set of records through a Portal
                MichaelWeisenberg

                Phil,

                No, I am describing a Portal, not a drop down list...My Portal includes add on scroll bars and that is why I refer to it as a "drop down". To make things easier, I am attaching a screenshot of my grading report layout. The screenshot is of my grading  report in layout mode. If necessary, I can also send you the same grading report as it appears in list view. Unfortunately, I can only send one JPG at a time. Please note there is an embedded portal in my report labelled as "Class Identification". This portal refers to my "Class Identification" table which lists each of my classes as a separate record. When I run the report based upon this layout (see list view attachment), my portal only displays one entry for each class and only shows the class for which the record is active. I had thought that when you embedded a portal, it would show all the records in your table (in this case, one record for each of my classes) and you would then choose the class from the portal scroll bar that you wished to filter for your report. Apparently, for the attached example, it does not work this way. My portal shows only the class for the record that is active on the report (in list or table view) but my report does list all records for each of my classes. Thus far, the only way I have been able to obtain the results for only one of my classes to display in my report is to perform a "find" by class. This works for me, but I had thought that the portal would enable me to filter by choosing the appropriate record for each of my classes. If you can confirm that my portal is working as expected in Filemaker, then, going forward, I will know to filter by "find" and I may even incorporate the scripting concept you recommended earlier. Thanks for your continuing help!

                michaelxjw

                • 5. Re: Selecting a set of records through a Portal
                  philmodjunk

                  I think you need to look up "portal" in FileMaker help and any training materials you might have. Wink

                  Your report is based on a found set of records--that's why you can perform a find to get the results that you need.

                  A portal displays a set of related records. The relationship you define linking the layout's table occurrence to the portal's table occurence determines what records are related. If you then define a portal filter, you can further reduce the records shown to only those related reocrds that match the portal's filter criteria.

                  Your layout is based on the table occurrence "Student Final Grade Computation". I can see it listed in the tool bar. Your portal is based on? I can't tell from your screen shot, but if you open portal setup for this portal, there's a drop down list called 'show related records from' that will identify its table occurrence.

                  Then if you open up manage | database | Relationships, you'll find a "box" named "Student Final grade computation" and another with the name in the drop down list from portal setup. There will be some kind of relationship linking the two occurrences and this relation controls what is seen in your portal.

                  It's common pracitice in fileMaker databases to use a value list such as a drop down list or a portal as part of a scripted method for selecting the group of records wanted for a report. The user selects a value from the drop down list or clicks a portal row and the script takes the value from the valule list field or the clicked portal row and uses it as criteria in a find to pull up the records. This could make producing your reports very easy to do and this was what I thought you were trying to do here.

                   

                  • 6. Re: Selecting a set of records through a Portal
                    MichaelWeisenberg

                    Phil,

                    Being relativley new to Filemaker, I apologize for not being as explicit as possible in describing my needs. With regard to the Portal, while the layout is based on the Student Final Gradee Computation table (I need that for my grade calculations), the portal is based upon my Class Identification Table. However, if I understand your explanation, I believe it is expected that you would often need to use the results of the records shown in your portal to further filter the found set for your report. To do this, you could use a script or even do a manual find on the record of interest shown in your portal. Am I correct in my thinking on this? As an extension of this, would it be possible to place a command button on your layout to run the find script you recommend or some other way of identifying the set of records you wish to filter? Thanks again for all your help!

                    michaelxjw

                    • 7. Re: Selecting a set of records through a Portal
                      schamblee

                      What Phil is saying is that  you don't really need a portal to select your class.  You could use a drop-down list of your classes then you would perform a find base on this class.   His code above uses a class id but, you could  us any field that you created to identify the class, such as class name.   

                      That being said you can get related records thru your portal.  Right click on one of the fields in your portal then click Button Setup.  Goto to Related records will show all related records to the field you clicked in the portal. 

                      Phil is the expert on this forum.

                       

                      • 8. Re: Selecting a set of records through a Portal
                        MichaelWeisenberg

                        S Chamblee

                         

                        Thanks a lot for your suggestion of using a button to automate the finding of related records through my portal. This may be just the solution I was looking for! Thanks again.

                        michaelxjw