Re: Report in FM 6 or 7
- From: Helpful Harry <helpful_harry@xxxxxxxxxxxxxxxx>
- Date: Sun, 25 Jun 2006 13:58:06 +1200
Okay, let's try this again - third (or is it fourth?) time lucky. :o)
Basically, you can't use a Summary part to insert the line because of
the way the records are entered and sorted. This means the only way to
achieve this report format will have to be done via scripting.
You need to keep the AgeDivision_Category Calculation field and a new
one to concatenate together Act, Event and Dance Teacher. These aren't
strictly necessary, but they will simplify the script and Sort Order.
eg.
AgeDivision_Category {Text result, Unstored}
= AgeDivision & "-" & Category
Act_Event_DanceTeacher {Text result, Unstored}
= Act & "-" & Event & "-" & DanceTeacher
You will also need an extra field "Report_DividerLine" that is either a
Container or a Text field, depending on whether you want a proper line
or a row of '_' characters. If you want a proper line then you'll also
need a Global Container field ('g_Line') used to permanently store a
line of the correct pen size and colour. You could also use a Global
Text field to store the row of '_' characters or you could hard-code
them into the script.
Plus some extra Global fields to use within a loop to store the data of
the NEXT record so it can be compared to the current one.
eg.
g_NEXT_AgeDivision_Category {Global, Text}
g_NEXT_Act_Event_DanceTeacher {Global, Text}
and a few of Text fields used just for the Report. These will be used
to display the "summarized" data only when needed and will be left
empty whne not needed.
eg.
Report_AgeDivision {Text}
Report_Category {Text}
Report_Act {Text}
Report_Event {Text}
Report_DanceTeacher {Text}
Next you'll need the script to produce the field data for the required
report format.
The script simply loops through the records backwards and inserts the
line into the appropriate record when either AgeDivision or Category
changes. It then loops through the records forwards to similarly set
the "Report_" fields only when Act, Event or DanceTeacher changes.
eg.
Sort [Restore, No Dialog]
Go to Record / Request / Page [Last]
Set Field [NEXT_AgeDivision_Category, AgeDivision_Category]
Loop
Go to Record / Request / Page [Exit After Last, Previous]
Set Field [Report_DividierLine, If (AgeDivision_Category =
NEXT_AgeDivision_Category, "", g_Line)]
Set Field [NEXT_AgeDivision_Category, AgeDivision_Category]
End Loop
Go to Record / Request / Page [First]
Set Field [NEXT_AgeDivision_Category, AgeDivision_Category]
Set Field [NEXT_Act_Event_Teacher, Act_Event_Teacher]
Loop
Go to Record / Request / Page [Exit After Next, Previous]
Set Field [Report_AgeDivision, If (AgeDivision_Category =
NEXT_AgeDivision_Category, "", AgeDivision)]
Set Field [Report_Category, If (AgeDivision_Category =
NEXT_AgeDivision_Category, "", Category)]
Set Field [Report_Act, If (Act_Event_DanceTeacher =
NEXT_Act_Event_DanceTeacher, "", Act)]
Set Field [Report_Event, If (Act_Event_DanceTeacher =
NEXT_Act_Event_DanceTeacher, "", Event)]
Set Field [Report_DanceTeacher, If (Act_Event_DanceTeacher =
NEXT_Act_Event_DanceTeacher, "", DanceTeacher)]
Set Field [NEXT_AgeDivision_Category, AgeDivision_Category]
Set Field [NEXT_Act_Event_Teacher, Act_Event_Teacher]
End Loop
Go to Layout [Report_Layout]
Page Setup [Restore, No Dialog]
Print [] OR Enter Preview Mode
The stored Sort Order is:
Act
AgeDivision_Category
Act_Event_Teacher
The Report_Layout is then simply set-up something like:
[Report_AgeDivision] [Report_Category]
[Report_Act] [Report_Event] [Report_DanceTeacher]
[Dancer]
[Report_DividerLine]
| Body
_________________
{sub-summary part used only to provide a gap between sections}
| Sub-summary by Act_Event_Teacher (trailing)
_________________
The normal 'Dancer' field is used so that if there are more than one
dancer per section, you will get them all listed under only one set of
section headings.
Make sure all the fields are set to "Slide up based on all above" and
to "also reduce the size of the enclosing part".
I *THINK* that does it (and seems to work for my simple test data), but
I could easily still be misundertanding something.
Helpful Harry
Hopefully helping harassed humans happily handle handiwork hardships ;o)
.
- References:
- Report in FM 6 or 7
- From: mprewitt007@xxxxxxxxx
- Re: Report in FM 6 or 7
- From: Helpful Harry
- Re: Report in FM 6 or 7
- From: mprewitt007@xxxxxxxxx
- Re: Report in FM 6 or 7
- From: Bill Marriott
- Re: Report in FM 6 or 7
- From: mprewitt007@xxxxxxxxx
- Re: Report in FM 6 or 7
- From: mprewitt007@xxxxxxxxx
- Re: Report in FM 6 or 7
- From: Bill Marriott
- Re: Report in FM 6 or 7
- From: mprewitt007@xxxxxxxxx
- Re: Report in FM 6 or 7
- From: Helpful Harry
- Re: Report in FM 6 or 7
- From: Bill Marriott
- Report in FM 6 or 7
- Prev by Date: Re: Equipment advice for a small network
- Next by Date: Re: Strange Behavior with Summary Fields
- Previous by thread: Re: Report in FM 6 or 7
- Next by thread: Calculation showing negatives
- Index(es):
Relevant Pages
|