You don't need the calculation field and it won't work with your setup. There are other ways to show the selected picutre, however:
Set up a one row portal to your picture table. Size this one portal row very large and place your container field from the photo table in this portal row. This one row portal can cover your entire layout if that's what you need. Define a portal filter such as:
Photos::SelectionField = "Cover"
and your portal will filter out all photos but the one that you have entered the single value "cover" into the selection field.
Define a new relationship that only matches to a photo record that has "Cover" in the SelectionField:
MainTable::__pkBridgeID = Photos|Cover::_fkBridgeID AND
MainTable::constCover = Photos|Cover::SelectionField
Photos|Cover is a new table occurrence of your Photos table. constCover is a calculation field that simply returns the text: "Cover". WIth this relationship, you can then add your container field from Photos|Cover and you'll see the selected cover photo on your layout.
Looking to above it seems you have 2 tables (Bridge and Photograph).
In Bridge table you keep the primary info for a bridge. and in Photograph table you keep multiple photos of bridges.
And Bride table and Photograph tables are matched by "Bridge_ID" which should be a primary key in "Bridge" table and foreign key in "Photograph"
Now in "Photograph" table there is a checkbox field called "Cover_Photo". If you will check this box then that specific photo will be in cover photo for suppose Bride A among all 20 photos for BrideA
You want that cover Photo displayed in Bride profile. Then you need to do below steps to get that.
--- Create a field called "ConstantOne" in Bridge table which is a global field with value 1
--- Create a relationship between Bridge To Photograph matching keys will be "Bridge_ID_pk" to "Bridge_ID_fk" and "ConstantOne" To "Cover_Photo"Where Bridge is the left side table and Photoghaph is the rightside table. You can name the right side "Photograph" relation ship name as "bridge_Photoghaph_BridgeCoverPhoto"--- Then create a field in Bridge table as "c_Cover_Photo" a calculated container field and calculation text will be bridge_Photoghaph_BridgeCoverPhoto::Photo--- Then in bridge layout put this "c_Cover_Photo" which will show the cover photo for that bridge.Thanks ElishreeFileMaker 11 Certified DeveloperSenior Software EngineerMindfireSolutions
That's awesome. Thanks to both of you for responding!
I'm sure all methods work but I've went with PhilMod Junk's option 1 (filtered portal) as it seems to keep things the simplest.
I'm moving on to the body of the report now and I'm sure I'll be back when I inevitably run into problems when trying to display multiple photos with Photo_Tag = "Report".
Thanks again for the help. As I surmised, I am having trouble putting together the photo portion of my report. To summarize my situation for just one of bridges:
I have 40 picutres in a Photo table that are related through a Bridge ID to an Inspection table. I have tagged 13 of the best photos to be in the report as "report" through a check box set in a Photo_tag field in the Photo table. I am trying to create a layout for a section of the report that displays the photos I have tagged "report". I want 4 picutres per page in a 2x2 grid. So in this case I will have three pages of four photos and 1 page of 1 photo and the photo report would be a total of 4 pages.
So far I have tried:
1) Creating a layout with 4-single record portals per page for five pages (20 total portals). Each portal would start at a different record (1 to 20). The portals were filtered as per PhilModJunk's option #1 above for the photo_tag="report". This would work if I always had 20 "report" photos, but unfortunately some bridges have less and some more. If they have less then the report prints blank pages for the "recordless" portals, and if they have more I am missing photos.
2) Creating a layout with the photo field and performing a find for my Bridge_ID AND Photo_tag="report". In this case I can get all the records I want to print but they are all stacked vertically (i.e. list mode).
I started to try and implement the solution by Elishree Dey but I realized that would only work for one photo.
I should also mention that I am bound to the 2x2 format as one of the client's conditions for allowing me to use filemaker for the inspections was that the reports looked exactly the same as the ones from previous reports prepared using excel.
Again, I look forward to any help you can provide. Perhaps I should start a new topic to get more traffic.
Set the portals, not the fields in the portals, to "slide up" / "Resize enclosing part". In preview mode and when printing, this will eliminate the empty space of unsused portals.
Thanks Phil, the use of portals was actually not the way for me as the photos were actually related to element records (bridge deck, bridge barrier etc.) therfore the report would create a report for each element instead of one for the bridge (confusing I know).
But in the end, you helped through a post on a different thread (screen shot posted to the bottom). It works perfect for what I am doing. If anyone else is going through this thread, the key is to follow the instructions below and modify the layout setup to print in however many columns you want.
I'm having only one problem that I am going to start searching a solution for now, but in the event that someone happens to read this and the answer is a quick one liner I'll post the question anyway: How to I get the header and footer to span both of my columns?
Thanks again Phil.