4 Replies Latest reply on Feb 12, 2015 6:06 AM by Stu412

    Dynamic Layout Parts?

    Stu412

      Title

      Dynamic Layout Parts?

      Post

      Is it possible to create a layout with dynamic parts?  The scenario would be a project list with the first sub summary part organised by Type of work.

      If the user then wanted to re-do the report by Staff, they can click a button and the first sub summary would now change to Staff, and so on.

      I can't see a clear way to do this, other than create a layout how I want it, duplicate it and change the part as necessary, and then use a button to navigate between the various reports.  Not exactly dynamic but it's an illusion.

      Thanks in advance

        • 1. Re: Dynamic Layout Parts?
          philmodjunk

          What you can do is include multiple sub summary parts in the same layout--each specifying a different break field. You can then get a number of different reports from the same layout simply by sorting your found set on different combinations of these break fields.

          I recently set up a report for my employer where the same report layout can show just the sub totals, or list the individual items under each sub total's heading using this method. What looks like a body layout part is really another sub summary layout part that specifies the primary key as it's break field. If I sort the records, including the primary key as the last sort field, the individual details appear. If I sort them again omitting this field, the individual details disappear....

          • 2. Re: Dynamic Layout Parts?
            Stu412

            Hi Phil

            Thanks for this, it works great and I've set up a three part report with scripted sort filters and it's going everything I envisaged....

            There is one question I have and this is only due to the nature of the information being shown that it's cropped up.

            Because I've got static fields to show staff, customer and task, when I sort by one of these, there's always the static version of the same data showing within the detail of the sub summary group.

            What I'd like to do is make this detail dynamic as well so that when I'm sorting by 'A', I don't see 'A', but instead see 'B' and 'C'.  When I'm sorting by 'B', the dynamic field(s) change to 'A' and 'C'.

            I've tried a couple of things with variables but they've not worked so far, although I think that might be a way to go.

            Have you ever done or seen anything similar?

             

            Thanks

             

            • 3. Re: Dynamic Layout Parts?
              philmodjunk

              If you use a script to sort your records in the different orders, that script can set variables or global fields to a value that indicates the specified sort order. Then you can use calculation fields or a "stack" of fields with "hide object when" expressions to display different data with different sort orders specified by your script.

              • 4. Re: Dynamic Layout Parts?
                Stu412

                Thanks for that, works great - I've steered clear of the Hide Object When and instead opted for calculation fields which vary the data in a given result field based on the value of the sort variable.