![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'd like to add an auto-numbering and subnumbering to my records, different from row numbering (@@). Likewise: 1. Region A 1. Client A 2. Client B 2. Region B 1. Client C 2. Client D 3. Client E The layout is based on Client reords which contain an ID to a related Region record, which is placed at the sub-mummery part. Can somebody ginve me a hint how to solve this issue. It must be something with Get (RecordNumber) and unique values... Thanx in advance. Twan |
)
#3
| |||
| |||
|
|
In article <4cbb1c6c$0$81478$e4fe514c (AT) news (DOT) xs4all.nl>, "Twan" no-reply (AT) skb (DOT) nl> wrote: I'd like to add an auto-numbering and subnumbering to my records, different from row numbering (@@). Likewise: 1. Region A 1. Client A 2. Client B 2. Region B 1. Client C 2. Client D 3. Client E The layout is based on Client reords which contain an ID to a related Region record, which is placed at the sub-mummery part. Can somebody ginve me a hint how to solve this issue. It must be something with Get (RecordNumber) and unique values... Thanx in advance. Twan "Sub-mummery part"?? You must be using the Ancient Egyptian version of FileMaker Pro. ;o) Get (RecordNumber) isn't really going to help since it's really the same as "@@". I think trying to do this style of numbering automatically is going to be A LOT more trouble than it's actually worth. If even possibe it would require a huge amount of work to set-up and personally I can't really see anything useful it is adding to the report. If you want the report to look like that, then the "easiest" method would be to use a Script to loop through the records inserting the appropriate Region and Client numbering, and then Print / Preview the report Layout. e.g. Enter Browse Mode [] Sort [Restore, No Dialog] Go To Record [First] Set Field [g_RegionCount; 0] Set Field [g_ClientCount; 0] Set Field [g_CurrentRegion; ""] Loop If [Region <> g_CurrentRegion] Set Field [g_CurrentRegion; Region] Set Field [g_RegionCount; g_RegionCount + 1] Set Field [g_ClientCount; 1] End If Set Field [g_ClientCount; g_ClientCount + 1] Set Field [RegionCount; g_RegionCount] Set Field [ClientCount; g_ClientCount] Go To Record [Next; Exit After Last] End Loop Where the Fields names starting with "g_" are Global Fields, or you could use variables in newer versions of FileMaker Pro. This Script Sorts the Records into the appropriate order you want for the report (e.g. at least sorted by Region), and then clears out any old data in the Global Fields from previous performs of the Script. It then loops through all the Records one by one, if the current Record's region is NOT the same as the previous Record's region (g_CurrentRegion), then the new g_CurrentRegion is updated, the g_RegionCount counter incremented by 1, and the g_ClientCount counter reset back to 0. Then the g_ClientCount Field is incremented by 1, the counter Fields for the current Record are updated, and the loop continues to the next Record, finishing when it gets to the end of the Found Set. The RegionCount Field should placed on the Layout in front of the Region Field, and similarly with the ClientCount Field - these two fields hold the numbers you want to display, as long as you remember to ALWAYS perform the Script before printing / previewing the report Layout It only loops through the Records once performing a few Set Field commands, so unless there are LOTS and LOTS of Records (or a very slow computer), it shouldn't take long to perform. Helpful Harry )
|
![]() |
| Thread Tools | |
| Display Modes | |
| |