January 14, 200520 yr Newbies Hi, Any idea how to have the number of pages printed depend on the length of a portal, but in a way that a footer text always prints at the bottom of the page?
January 14, 200520 yr It's recommended to print portal items from their own file (the portal-ed file, not the portal-ing file).
January 14, 200520 yr "portal-ed" and "portal-ing" LOL Are these terms in "Learn FileMaker Pro 6..."?
January 14, 200520 yr Yes...along with the terms table porter-er (the table doing the portal-ing), table porter-ee (the table being portal-ed), and portal-ist (the FM programmer setting up the portal). Isn't English a great language?
January 15, 200520 yr To get back to the question at hand, this is quite difficult to do. It is better to make your print layout in the database being viewed through the portal, thus using a regular list layout to print and not use a portal at all.. But if you absolutely have to do this ... I had a situation where I was forced to. I was printing packing slips where most of time the ordered line items were twenty or less. My layout would accomodate up to twenty. Then came a 25-line order one day (very rare in what I'm doing). What I did was duplicate the print layout and redefine the portal on the dupe for a different relationship. My script runs a subscript in the line item database that isolates the 25 on this order, sorts them, goes to the first record, then omits-multiple 20. I now have a found set of items 21-25 to be printed on page 2. I made a text field and the script will replace-with-calc the text: "Page2" & PrimaryKeyField. Back in the header database where the print layouts live, I made a calc field that is always "Page2" & PrimaryKeyField. The redefined portal on the dupe print layout is now based on a relationship between the "Page2" fields. It will only display lines 21-25 in my example, and be empty if the order is less than 21 lines. To make it fancy, I made another dupe of the original print layout, and removed the totalling footer altogether. This "Page1" layout will list the first 20, but the totals will only appear on page two. Finally, the master script that prints these things is looping through all orders to be printed. It is testing the line item record count. If it finds one over 20, it goes to the new "Page1" layout and pauses. I print (manually). When unpaused, it switches to the Page2 layout and pauses. I print again. When unpaused, it returns to normal layout and normal activity for the rest of the orders. Perhaps I could automate the printing itself into the script, but these two-pagers come along one in every several thousand orders, so it's not worth the trouble. Steve Brown
January 17, 200520 yr Author Newbies Thanks guys, I see it is quite hard to do. If I only could define a section to slide that would be great ... So the layout section where the portal is slides, footer section doesn't. I can see that this is very hard to accomplish for FM. And yes, it is used for packing slips. Well, to save time I will just pre-print the footer on the paper. I could also duplicate the one page layout and make it two pages. This way if I see i don't have enough rows, I just toggle to the longer layout. I could even script that like you proposed Steve, thanks!
January 17, 200520 yr You might play around with a trailing grand summary part instead of a footer. It will efectively slide up to the bottom of a list, though I don't know how it would react to a portal. I would imagine it would treat the portal as a single static object with a height equal to the defined max number of rows, regardless of the number of rows being displayed. If you decide to go the route I outlined, let me know and I'll give you pointers regarding the initial scripts that rope together the over-sized order. It sounds more complicated than it is. It took me about two hours to set it up. Steve Brown
Create an account or sign in to comment