9 Replies Latest reply on Jun 4, 2015 6:05 AM by philmodjunk

    Shrink a portal to remove blank rows

    Stu412

      Title

      Shrink a portal to remove blank rows

      Post

      I have a need to use a portal to display rows and columns of data on a print layout.

      The portal is set to 15 rows high which is large enough to accommodate all needs.  Beneath the portal I have some totals for the column data which is displayed within the portal.

      If a customer has only 15 rows of data, the grand totals appear good.  If the customer has only 5 rows, obviously the totals are far removed from the data their summing up.

      I've looked at trying to make this work in a list report, but because of the nature of the raw data (which cannot be changed) I do not think this will be suitable.  On a list, you break by A group, but I need to break by MANY groups (group1+group2+group3 etc).

      The portals also offer some good filtering which is needed as well.

      So, can we shrink portals so that they use only the rows they need?

      If so, can I make other objects on the layout move with them?

      Thanks

       

        • 1. Re: Shrink a portal to remove blank rows
          JesseH

          Stu412,

          If you use the "slide objects up" option, found in the position tab in the "investigator window", on the Portal and any fields or text beneath it, this will "shrink" the objects together. From my experience you will only see this happen in preview mode.

          Hope this helps

          • 2. Re: Shrink a portal to remove blank rows
            philmodjunk

            For sliding to work, be sure to also select "resize enclosing part".

            But I do not see a reason in your first post that would make a list view method unworkable. You can certainly group your records under and below sub summary layout parts and put summary fields inside the sub summary parts to show a total of just the records grouped with that sub summary part.

            • 3. Re: Shrink a portal to remove blank rows
              Stu412

              Hi 

              I've managed to sort this using a list method - I needed to add some higher level break fields to the data and this now works fine.  

              I have two more schoolboy questions!

              1) Within the data I'm reporting on, I have some records I don't want to see in the list report.  These have the break field of 'XXX'.  I am sorting the report on a custom list which is defined as 'Sales A', 'Sales B', 'Sales C' etc with each of these being the name of a break field.  

              How do I exclude the 'XXX's from the report?

              2) The idea of the report is to show only data relating to a single customer, although the report itself when viewed in isolation shows data relating to all customers due to the fact it's based wholly on its own table with customer IDs on each record.  The use case is to click a button on the customer parent layout and move to this report whereupon you would see only data relating to that customer.

              How do I exclude all other customer's details and just show those relating to the parent layout I've just come from?

              Sorry if these are dense - my FM experience is by no means a structured journey!

              Thanks

              • 4. Re: Shrink a portal to remove blank rows
                GuyStevens

                If you have a list view and you want to show only data from one customer you need to perform a find.

                This find can be performed by a script in the background so you never need to worry about it.

                On your customer detail layout you can have a button that:
                - Takes you to the list layout
                - finds only the records related to that customer
                - Maybe even performs a sort for your break fields and sub summary parts

                And then you will have a list with only the records for this customer.

                To find records for this customer you need to first set the customers ID as a variable. Then go to the list layout and perform a find using the variable you created.

                Greetings
                Guy

                • 5. Re: Shrink a portal to remove blank rows
                  Stu412

                  Guy,

                  Thanks for the help:)

                  One thing I've just come across, I'm trying to exclude records based on a multiple filter, so in this case I have my 'XXX' records, I've excluded them, but also want to exclude the 'YYY's

                  The script is simple enough but I cannot make it work on XXX and YYY

                  Enter find mode[]

                  New record/request

                  Set field [Table::FilterField;"xxx"]

                  Omit record

                  Perform Find[]

                  This works, but I cannot make it work for the 'YYY's even if I duplicate the code.

                  How would I be able to do this please?  Find not my strong point!

                   

                  • 6. Re: Shrink a portal to remove blank rows
                    GuyStevens

                    This depends. You can either loop through the records and omit all the records you don't want to see.

                    Or you can constrain a found set by doing a second find and omitting those found records.

                    Look here for some more info: Link

                    • 7. Re: Shrink a portal to remove blank rows
                      philmodjunk

                      Enter find mode[]

                      New record/request

                      Set field [Table::FilterField;"xxx"]

                      Omit record
                       New record/request
                      Set field [Table::filterfield ; "yyy" ]
                      omit record

                      Perform Find[]

                      For just two such "omits" no loop is simpler

                      • 8. Re: Shrink a portal to remove blank rows
                        Stu412

                        Thanks for the help one and all.  This works great now, my script had the error of trying to Enter Find Mode[] after the first Omit - I thought you needed to enter find mode afresh for each new find.  

                        • 9. Re: Shrink a portal to remove blank rows
                          philmodjunk

                          It does, but there's no new find here. The script is creating two find requests, but performing only one find.