4 Replies Latest reply on Feb 20, 2017 2:21 PM by realgrouchy

    Page break question

    Stu412

      Hi all,

       

      Hopefully this is a simple one but I cannot get right.

       

      I have a sub summary report set up like this:

       

      • Header
      • CustomerID (Leading)
      • SortField(Leading)
      • TransactionCode(Leading)
      • SortField(Trailing)
      • TrailingGrandSummary

       

      The report is used for all customers and the length of the report will vary depending on the numbers of transaction rows in the TransactioCode part.  These are in turn subtotalled in the SortField (Trailing).

       

      That's where the question lies.

       

      I need to set the report to put a page break on the SortField(Trailing) section ONLY when there are 15 rows or more in the TransactionCode section.

      This will mean that long reports break on the subtotal, short reports stick to one page.

       

      I tried 'After 15 occurrances' on the TransactionCode (Leading) section, but this obviously does not display the sub total below it - that's carried onto the next page.

       

      So, to summarise:

       

      If I have more than 15 transactions, break on SortField (Trailing)

      If I have less than 15 transactions, put the entire report on one page.

       

      Hope that makes sense.

       

      Thanks in advance for any help

        • 1. Re: Page break question
          Johan Hedman

          Then I would have two layouts and look at number of records. If there is more then 15 go to the other layout

          • 2. Re: Page break question
            Stu412

            So one solution I have come up with (given the request that everything be on one page) is to:

             

            Print to PDF

            Properties

            Advanced

            Scale to 85%

             

            The hard copy printers here don't seem to have the necessary drivers to scale properly from FM but the PDF drivers do.

             

            johanhedman your response would have been my what I'd have tried next if it wasn't for the intervening client curve ball of 'One page please'! Thanks for the input

            • 3. Re: Page break question
              Johan Hedman

              If your goal is a PDF then you could always Append. So start with start parts and then depending on number of records Append different parts from different layouts

              • 4. Re: Page break question
                realgrouchy

                I don't completely understand the question, and I don't know if this would work, but what if you tried something along these lines:

                - Have a calculation field that simply equals the unique value of the individual record

                - Have one summary section that includes a page break and references the original record

                - Have another summary section that doesn't include the page break and references the calculation field

                - Have a script that runs OnLayoutEnter (or similarly triggered) that sets the layout to sort based on either the unique field or the calculation field, depending on whether or not there are at least 15 records.

                 

                I've used similar techniques to avoid having to use two separate layouts for very similar reports. Only one of the subsections appears on each report, because the non-relevant field is not used in the sorting.    

                 

                - RG>