dbTalk Databases Forums  

numbering group sections and detail rows

comp.databases.filemaker comp.databases.filemaker


Discuss numbering group sections and detail rows in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Twan
 
Posts: n/a

Default numbering group sections and detail rows - 10-17-2010 , 10:55 AM






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

Reply With Quote
  #2  
Old   
Your Name
 
Posts: n/a

Default Re: numbering group sections and detail rows - 10-17-2010 , 10:05 PM






In article <4cbb1c6c$0$81478$e4fe514c (AT) news (DOT) xs4all.nl>, "Twan"
<no-reply (AT) skb (DOT) nl> wrote:

Quote:
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 )

Reply With Quote
  #3  
Old   
Twan
 
Posts: n/a

Default Re: numbering group sections and detail rows - 10-18-2010 , 03:15 AM



Thank you very much for your assistance.
Modifying the filtered and sorted recordset before displaying the
report, seems to be the most practically way to so so.
Hopefully in the next version FMP will support other variants of @@ to
number the details and group sections and optionally restart the
sub-numbering within a group section.

Twan

By the way, you make me smile by your comment about my "sub-mummary"
typo... :-)



"Your Name" <your.name (AT) isp (DOT) com> wrote

Quote:
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 )

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.