May 23, 201213 yr I have a print form set up to print multiple pages. It uses several tabs, showing the related records in a portal with a finite number of rows on each (1-25, then 25-50, etc.), and the print script switches tabs as needed for the count of related items. I now need to place a quantity total below on each tab, summarizing just the quantity field from related records of the portal range shown on that one tab. So I need to a field to calc sum(quantity) from related records 1-25, and another for 25-50. Trying to find something more graceful than a written out Get Nth, given I am recursive-challenged. No sort on the portal, this is just based on count 'range' of related records as entered order. This is real just about summarizing the records by range, and the portal itself is irrelevant. Of note, it's a preprinted triplicate form on a roll fed strike printer, and requires precise graphic alignment, so would prefer to maintain the tabbed pagination rather than redo and face alignment issues to utilize summary breaks just for this one new addition.
May 24, 201213 yr Of course, this would be a lot easier if you simply printed from a list layout of the child table. Still, have a look at the attached. SumRange.fp7.zip
May 24, 201213 yr Author Of course, this would be a lot easier if you simply printed from a list layout of the child table. RUNNING total! Beautiful, many thanks! Yes, a child report would be a no brainer (except for pesky alignment issues), but this will make the user very happy.
May 24, 201213 yr Author Refined so it doesn't mind a partial filled portal, and my hard coding for the portals. Let( [ CountTotal = Count(parent::children); StartN = 1; EndN= 25; RunTot = children::Quantity_srun]; GetNthRecord ( RunTot ; If (CountTotal < EndN; CountTotal; EndN) ) - Case ( StartN > 2 ; GetNthRecord ( RunTot; StartN - 1 ) ) ) Thanks again!
Create an account or sign in to comment