5 Replies Latest reply on Apr 24, 2009 4:46 PM by philmodjunk

    Printing data from portal / printing data from many-to-many relation

    willem67

      Title

      Printing data from portal / printing data from many-to-many relation

      Post

      It has been suggested many times that it is not easy to print data from a portal. Very often one suggests to print from the related record. But I use a many-to-many relation. 

       

      Situation: 

       

      Two tables:

      1. paintings

      2. exhibitions

       

      With a many-to-many relation I have portals in both tables. I can see which painting was in which exhibition; I also can see all the paintings in a particular exhibition.

       

      I just would like to print a list of all the paintings in a exhibition, e.g.. as a list......, or a list of all the exhibitions where a painting has been.

       

      Has anyone come up with a solution? I would imagine that printing the data of a portal would be really in demand.....

       

      Willem 

       

       

        • 1. Re: Printing data from portal / printing data from many-to-many relation
          philmodjunk
            

          Describe how you implement the many to many relationship. Usually this is done with a third, join table. Is this how you've done it?

           

          Once you describe your releationship we should be able to help you do what you need pretty easily.

          • 3. Re: Printing data from portal / printing data from many-to-many relation
            philmodjunk
              

            Create a layout that uses the Join table as your underlying table.

            Place the fields from exhibitions and paintings that you want to see in your report on this layout.

            Perform a find to find all records for a given exhibition and you'll get your report listing all the paintings for a given exhibition.

            Perform a find to find all records for a given painting and you'll get your report listing all the exhibitions for a given painting.

             

            Make sense?

             

            If you don't know how to create sub summary parts, you'll probably want to learn how to add those to your report as well. (Sub-summary parts allow you to group records under subheadings.)

            • 4. Re: Printing data from portal / printing data from many-to-many relation
              willem67
                

              This is exactly what I needed.

               

              I made a sub-summary report in list-view and made a script for that as well. From a record I can go directly into the report that shows all the data fromthe portal.

               

              Super easy!

               

              (But why do many insist on the opinion that you cannot print portals?)

               

              Willem 

              • 5. Re: Printing data from portal / printing data from many-to-many relation
                philmodjunk
                  

                In your case you didn't print a portal. You printed a list view layout with sub summary parts. This is usually the better way to print data that has been entered into related tables via a portal. It gives you much more flexibility.

                 

                Actually, One of my databases prints invoices from a layout that has a portal on it. It's been doing that since it was an FMP 3 or 4 database. You can print layouts that display data in portals, IF you understand their limitations and can work within them.

                 

                The most significant reason people advise you not to print from a portal layout is that if your portal has to scroll to display all the related records, printing that layout won't show all the rows.

                 

                In the case of my invoices, the data entry screens use nonscrolling portals with the same number of rows as my output layout. Since the user can never enter more rows than are visible in the layout, I can print my invoices using a portal in the layout.