June 8, 20241 yr Hello, I have a layout that displays a homeowner inspection report. The first page should show a header (name, address, comments, etc. and two of a possible 8 photos of the home. The second page should show the subsequent 6 of a possible 8. I set the layout up with a Sub-summary by Lot at the top to show the lot specific info and the first two photos (two single row portals starting at the record 1 and record 2 of the linked PhotoList table respectively). Then I set up the Body with the other six photos, using 6 portals, starting at record 3-8 of the Photolist respectively. Here's the first page = Leading sub-summary: Here's the second page = Body: I've tried all kinds of combinations of part page breaks, sliding and hiding objects, resizing enclosing parts etc, but I can't for the life of me figure out how to set it up so I get one page if there are 0, one, or two images and two pages if there are 3 or more images with the page breaks in the right place. Rather than document everything I've tried and the current behavior, I figure I'll ask how to do it correctly. Any guidance would be greatly appreciated...
June 8, 20241 yr Portals are not well-suited for printing. If the number of photos you need to print is not constant, base your printing layout on the Photos table, and put only the photos in the Body part. You can use columns to print the photos in pairs: https://help.claris.com/en/pro-help/content/print-records-columns.html And I believe you can print all your photos in bulk, without making a special arrangement for the first two.
June 8, 20241 yr Usually when blanks occur, is it because the page length isn't correct according to the sheet length, that is the division isn't into two equally lengths in integer. Try to shrink by a percentage or two, and watch it in preview ... --sd Edited June 8, 20241 yr by Søren Dyhr
June 9, 20241 yr Author @comment, that helps and certainly makes the layout simpler to understand and manipulate. Unfortunately, there are also reports to print that do not have photos associated with them. Any way to handle that without doing separate layouts for the two cases?
June 9, 20241 yr 33 minutes ago, BAleiHi said: there are also reports to print that do not have photos associated with them What do you want the first page to look like in such case? IIUC, you reserved a space for the first two photos at the bottom of this page, whether they exist or not; should this be kept blank? Is there anything that needs to be printed after the photos (other than the footer)?
June 9, 20241 yr 2 hours ago, BAleiHi said: Any way to handle that without doing separate layouts for the two cases? Even so would I clone the layout, and remove the body part in the cloned, and then let the script arriving in the reporting, make a decision of which to utilize... --sd Edited June 9, 20241 yr by Søren Dyhr
June 9, 20241 yr Author Thanks to both of you. I decided to go with Soren's approach - and was able to do it with only one layout, based on the Owner table. For the page to appear to break correctly I used a kludgy workaround. When there were more than two photos, the first page showed only a fraction of the top of the second page. So little that when I corrected each part size to the maximum for the page (712 pixels in my case) as Soren suggested and slid things as far down the second page as I could, the only thing showing on the first page is the border of the portal row. I fixed that by setting the format to no line. I was even able to slide the image container down within the portal row to give a little extra top border on the second page. Several hundred iterations I'm sure, but ultimate success. I get that FM is not a work processor, but geez can't they implement a more predictable and effective reporting/printing scheme. In previous solutions I have exported data to Excel simply to use its formatting and printing capabilities. Ughh!
June 9, 20241 yr It sounds like you did not take advantage of the page margins and page breaks indicators that are available in Layout mode. My preference would be to print only the first page from a layout of the parent table. Then, if there are any photos, do GTRR to the Photos table and print them in columns. If you must have the first 2 photos on the first page, then use the 2 portals you already have, and if there are more than two, omit the first 2 records after doing GTRR.
June 9, 20241 yr Author I did use page margins and page breaks but they don't really show where the breaks occur, presumably due to sliding? My current workaround seems to be fine and avoids having to have a script to manage the printing in two separate print steps per report with two separate layouts. I'm also not clear on how I would collate together the outputs, particularly on a batch job where I need to print 300-400 reports. But I definitely appreciate your sharing your approach and will use it if my current solution gets flaky with, say, a different printer setup or something.
June 9, 20241 yr 28 minutes ago, BAleiHi said: how I would collate together the outputs, particularly on a batch job where I need to print 300-400 reports. I suppose the same way as you would with your method. The script can loop over the parent records and print all the relevant pages for the current record in sequence before moving to the next one. The only possible complication would be if you wanted the entire report to have consecutive page numbers - but that too can be solved.
June 10, 20241 yr I'm wondering why this problem has shown up, I would approach it as - Go to the most atomic of the tables needed for the print or pdf'creation. Like Michael did in his suggestions? Could it be that the vital missing piece in the equation is: https://support.claris.com/s/article/Append-to-existing-PDF-in-FileMaker-Pro-1503692937780?language=en_US --sd
June 10, 20241 yr 40 minutes ago, Søren Dyhr said: why this problem has shown up It's a common problem, where you want to report on parents and their children, whether they have any or not. This is why SQL has LEFT OUTER JOIN.
June 10, 20241 yr 1 hour ago, comment said: It's a common problem, where you want to report on parents and their children, whether they have any or not. This is why SQL has LEFT OUTER JOIN. A way of preventing the use of portals could be done with this: Let( tt = Count( Extend( Images::PrimaryKey ) ); Case( tt ≥ Get( CalculationRepetitionNumber ); GetNthRecord( Extend( Images::TheImage ); Get( CalculationRepetitionNumber ) ) ) ) And then build the body-part with broken up repeaters splayed, the condition is there to make the sliding of the object to happen, because if an image doesn't exists the calc, exhibit a question mark... with calculated container fields. --sd Edited June 10, 20241 yr by Søren Dyhr
Create an account or sign in to comment