4 Replies Latest reply on Feb 18, 2014 5:46 AM by philmodjunk

    Setting auto Window size.

    morganbleak

      Title

      Setting auto Window size.

      Post

           I have tried using the Adjust Window [Resize to Fit] while using a Trailing Grand Summary part to have the window resize whether a few records or many but I end up with a stretched out Grand Summary part.  It looks really bad in this view.

           So, I am trying to build a script using the "Body Part" to set the window height.   I can't find the function that lets me use this in the script.  I can imagine that I will have a problem figuring out which step to use for auto width also. 

           Or, maybe there is a better way to auto-size a window.

           I read one posting that said the Body Part could be used but the moderator failed to specify how to.

           Regards,

           Morgan

        • 1. Re: Setting auto Window size.
          philmodjunk

               It would appear that the layout specified for the window is displaying multiple records. You can take the number of records in the found set and multiply it by the height of the body layout part to get a figure for the height that part of your layout.

          • 2. Re: Setting auto Window size.
            morganbleak

                 Thanks Phil.  So, I will take FoundCount number * the Height of the body part (derived by me using an estimate or by using the number used in the height position of the body part) to arrive at the adjustment size.  Is this correct?

                 I thought there might be a magical function formula to use to calculate the body part size in it's static position (unpopulated layout).  

                 I forgot to say this will be used on various list view layouts.

                 Thanks,

                 Morgan

                 I tried it and find that the window responds well, except that it is covering half of the records.  Does the "get(FoundCount)" function retrieve its own number from the records that are to be displayed in the window or is it trying to use my field in the table called "FoundCount" to obtain the number?

                 Morgan

            • 3. Re: Setting auto Window size.
              morganbleak

                   Phil, Here is an image of the script.

                   Morgan

              • 4. Re: Setting auto Window size.
                philmodjunk

                     What I described only accounts for the body of the layout. You still have to account for the rest of the elements that make up your window such as a header, footer, the tool bar plus additional pixels for the other parts of your window. These other parts, however should be constant so you should be able to come up with an expression that is:

                     Value + BodyHeight * Get ( FoundCount )