3 Replies Latest reply on Oct 6, 2015 3:45 AM by erolst

    Building A Layout Of Variable Page Lengths

    kabetz

      I have a table that contains a list of companies.

      I have a table that contains a list of images.

      The tables are related.

       

      What I am trying to do is build a layout that will print out the images for each company.

      The problem is that some companies may have 3 images and some may have 5 images.

      I can't figure out what fields I put in the layout so that the layout will print only the pages it sees for each company.

       

      As an example, I may have 5 companies and 34 images.

      Company 1 = 12 images

      Company 2 = 4 images

      Company 3 = 0 images

      Company 4 = 10 images

      Company 5 = 8 images

       

      I want to build a layout that allows me to print etc.

       

      Is there a way to do that?

      Thanks

        • 1. Re: Building A Layout Of Variable Page Lengths
          erolst

          kabetz wrote:

          What I am trying to do is build a layout that will print out the images for each company.

          The problem is that some companies may have 3 images and some may have 5 images.

           

          Actually, the real problem is that there are companies with 0 images – otherwise the easy solution would be to base your print layout on the images table. But then companies with 0 records would not be represented.

           

          Another idea: create a calc field in the Company table, type container, with, say, 20 repetitions, and define it as

           

          Let (

            i = Get ( CalculationRepetitionNumber ) ;

            Case (

              i <= Count ( Image::image ) ;

              GetNthRecord ( Extend ( Image::image ) ; i )

            )

          )

           

          Place the field into the body part with, say, two copies à 10 repetitions, and apply sliding to that field.

          • 2. Re: Building A Layout Of Variable Page Lengths
            kabetz

            Thanks for that.

             

            It would be possible for me to remove all companies with 0 images.

             

            Would that offer a simpler solution?

            • 3. Re: Building A Layout Of Variable Page Lengths
              erolst

              kabetz wrote:

              It would be possible for me to remove all companies with 0 images.

              Would that offer a simpler solution?

               

              Well, no need to remove anything; just create a report layout based on the Image table, using fields from both Image (e.g. image) and Company (name etc.), with a sub-summary by company name (and consequently, the found set being sorted by company).

               

              As mentioned, companies without an image simply won't show up.

              1 of 1 people found this helpful