Pseudoportals with Alternating Fill
Among my longest-standing feature requests for FileMaker are portal rows that slide individually to accommodate their content. Although I can usually get by with constructing my layouts in the related table, that’s an approach that usually leaves something to be desired. My favorite workaround, to date, has been what I call a “pseudoportal” (though I’m sure there’re other names for the technique).
To the left is an example of what I mean. This effect can’t be achieved with portals (as far as I know). In this example, the canonical approach would be to construct a layout based on the invoice line items. However, doing so would make it impossible for me to put in the text element down the right side, or to incorporate related data from multiple tables.
To solve the problem, I create repeating calc fields in the invoice table and define them to refer to specific related records, depending on the repetition. For example:
Let (
[
f = Extend ( PO_LineItems::Item );
g = GetNthRecord ( f ; Get (CalculationRepetitionNumber ))
];
If (g<>”?” ; g; “”))
Now, although FM 9 didn’t fulfill my wish of making this technique obsolete, it did offer a fix for one of the shortcomings of the technique – alternate row shading. To achieve this, make sure one of your pseudoportal fields extends the width of the whole set (usually, I just use the first field). Set conditional formatting on it for the color you want using this formula:
mod ( get (calculationRepetitionNumber);2) = 0
Here is a link to a technique file that illustrates what I’m talking about (it doesn’t have the shading, since I built it before 9):
http://www.petervinogradov.com/TechniqueFiles/PV_PseudoPortals.zip
The file also includes some fun CFs and examples for automatically balancing multi-column pseudoportals.
Comments
2 Responses to “Pseudoportals with Alternating Fill”
Leave a Reply
You must be logged in to post a comment.
The text element down the right side of the invoice can be achieved in a layout from the child table. You can add a sub-summary part that will not be used so that you can create space. Then add the text object so that it starts in the header part.
With creative use of the conditional formatting you can also achieve alternating row colouring too.
I have a sample file if you want to have a look.
Cheers, David
Thank you for pointing that out.
The invoice example isn’t actually one I use. Typically, this technique comes in handy when I need to arbitrarily balance the related records into multiple columns, which is tricky (okay, tricky for me) using FMs multi-column print controls.
The other issue involves having data from multiple relationships. I’m working on a problem right now that requires showing sliding portal rows from two separate relationships side by side. Not sure how I would do that in a child table.