14 Replies Latest reply on Oct 19, 2013 3:44 PM by ecroissier

    Invoices of varying lengths

    RPaulH

      Most of our invoices are 1 page, but every now and then there is a very long one and I am looking for suggestions on alternate formatting for this layout. I have attached 2 pdf files one is a 1 page and the other is more. The long one also has text that extends beyond the space allowed in "Description of Work" which means I have to extend that field and adjust portal rows in the layout to the next page, which leaves me with few portal rows on the page. Every item is a field in the active table except for the Item Detail rows which are in a related "Invoice Detail" table and exist as a portal on this layout. Maybe I'm just not looking at it right, wouldn't be the first time today. Thanks, Paul

        • 1. Re: Invoices of varying lengths
          techt

          I think you can resolve this by setting the description of work field as almost full page, and then set sliding to shirk that field as needed. I've had similar issues in the past with invoices and sliding should take care of it for you.

          • 2. Re: Invoices of varying lengths
            RPaulH

            techt,

            As I said in the post I can extend that field and slide it, but if I do that I have to set the portal for less rows on the page I am on and more on the following pages to get past the page break. My portal is 55 rows long and we have that many items occasionally. It's the page breaks that kill me.

            Thanks,

            Paul

            • 3. Re: Invoices of varying lengths
              chris.schmitz

              Something you should try is using the different layout parts instead of portals. Set it up from top to bottom like:

               

              Layout setup - list view, Show records from the table that you're currently pointing the portal to.

               

              ----

              Header - Everything from your logo to your description of work. Like techt mentioned above, make the description of work large and set the sliding settings to shrink the field (which will happen only in preview mode) and also check the 'also resize enclosing part' checkbox. When you check that and have an object with sliding turned on, it will fit the layout part to the actual data.

               

              Body - Your fields that are currently in the portal

               

              Footer - Your subtotal, sales tax, and total fields

              ----

               

              When you do it this way and then write a script to go to all the records in your portal in this layout (which can be as simple as a go to related records from (theportaltable) using layout (thisnewlayout) and then enter preview mode, it will resize your description and the body records will extend as long as they need and roll over to the next page if necessary.

               

              From here you can also get into more fancy stuff like adding a sort records step to the script and using sub summaries to divide the records in the list, show subtotals per categories, etc, but at the very basic level this header-body-footer is the best way to allow FM to dynamical extend and contract a print layout.

              • 4. Re: Invoices of varying lengths
                DaveRawcliffe

                Paul,

                 

                Follow up to Chris's comments.

                 

                Print from the Invoice's Line table, with printout layout setup as:

                 

                 

                Title Header for Page 1 - containing the Invoice Description, Invoice Details ( IDs, Dates etc. ) & Column Headers

                 

                Header for Page 2 - containing minimal Invoice Detail & Column Headers

                 

                ^  Related fields from Invoice

                ^-------

                 

                Sub Summary if required

                 

                Body

                 

                Sub Summary if required

                 

                Trailing Grand Summary for your totals

                 

                Footer

                 

                Title Footer if required

                 

                HTH

                Dave

                • 5. Re: Invoices of varying lengths
                  RPaulH

                  Chris & Dave,

                  Thanks for the idea, funny but I never thought of printing from the detail table. Have one big problem though. My Description sometimes runs onto the second page and the title header will not allow this.

                  • 6. Re: Invoices of varying lengths
                    DaveRawcliffe

                    Paul,

                     

                    Title Header can be a full page.

                     

                    How about using a smaller font.

                    If I remember correctly, 8 pt is the minimum permissable size for legal documents.

                     

                    A thought

                    Dave

                    • 7. Re: Invoices of varying lengths
                      Stephen Huston

                      Hi Paul,

                       

                      You can also set Conditional Formatting to reduce font size on a field or text object based on its length.

                       

                      I have used this type of Conditional Formatting to shrink text to varying point sizes depending on the number of letters in the content using [ Length(Self)>## ] so that longer entries reduce to fit -- unless they are way out of range.

                       

                      A layout based on the detail/line-item will certainly give you the flexibility to use multiple pages as needed, and is far more flexible than having to switch layouts for longer invoices.

                       

                      Stephen Huston

                      • 8. Re: Invoices of varying lengths
                        RPaulH

                        Thanks guys but neither of those would work in our world. Actually solved it by creating an Addendum that will house the detailed description as a separate document. Have another problem however. I have attached a pdf of the invoice. As you can see my line items start low on page 1. Everything on page 1 is in the Title Header and sliding up correctly except the Title header itself is not decreasing in size. The position where the line items start is where the Title Header ends in layout mode. After the Title Header is the Header with just the column headers followed by the Body which has the fields in it. Then Trailing Grand Summary and Footer. No matter what I do page 1 will not close the space. Ideas?

                        Thanks, Paul

                         

                        Forgot to attach

                        • 9. Re: Invoices of varying lengths

                          Hi Paul,

                           

                          Have you also checke the box that says "Also resize enclosing part"?

                           

                          You would need make sure to have that box checked for every obect that you are wanting to slide.

                           

                          I hope that helps,

                           

                          John

                          • 10. Re: Invoices of varying lengths
                            DaveRawcliffe

                            Paul,

                             

                            Headers Parts do not reduce "slide up" only Body do.

                             

                            Title Header should sized to contain only;

                            Invoice Number down thru the Column Titles (as shown pg 1 your pdf) no white space below these.

                             

                            Header should sized to contain only;

                            Invoice Number and Column Titles (as shown pg 2 your pdf) no white space below these.

                             

                            In Browse mode;

                            Page 1, Body should start displaying immediately below Title Header.

                             

                            Page 2, Body should continue displaying immediately below Header if required.

                                         ( note Code & Tax are below Header for some reason )

                             

                            HTH

                            Dave

                            • 11. Re: Invoices of varying lengths
                              RPaulH

                              Yes the reduce part is checked. I didn't know the headers would not slide up. My Description of Work field is sometimes 30 lines long. It is larger in the layout than you see in the example to accomodate more text. The Body is displaying directly below the Title Headers' actual size in layout mode, just thought the Title Header would also shrink. Would like to not have to give up that much space on the page but it look like no choice. Thanks for the help, Paul

                              • 12. Re: Invoices of varying lengths
                                fijiDeveloper

                                I manage to fix the problem by doing the following;

                                 

                                1. Create a calculation field that determine the length of the description/particular.
                                2. You need to test for what length would fit on 1 page, 2 page, and more.
                                3. Create a condition within your script that if it is within the 1 page range, then print only 1 page. Otherwise to the necessary

                                 

                                It worked out fine with me, also with my client a legal firm.

                                • 13. Re: Invoices of varying lengths
                                  Stephen Huston

                                  Hi Paul,

                                   

                                  If you are reporting from the line-item table, you can replace the header with a leading grand summary part, which, unlike a header, should be able to shrink in size when printing.

                                   

                                  You can also use a trailing grand summary part for all of the stuff that comes after the line-items on the invoice, and still use a footer for page numbering or the like if you want. The trailing grand summary can include the tax/total stuff and will rise to fit immediately after the last line item.

                                   

                                  If sorting of line-items is an issue, you can sort them by creation timestamp to keep them in the order written. That lets you add sub0sum info which appears only when the line-item records are sorted correctly.

                                  • 14. Re: Invoices of varying lengths
                                    ecroissier

                                    Great approach for the solution of this problem!

                                     

                                    Can you share any capture, layout and/or, your script or even a little Fmp demo file for knowledge of the forum ?

                                     

                                    Thank you.

                                     

                                    Greetings from another island in paradise

                                    --

                                     

                                    Edu