Re: Report in FM 6 or 7




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)
.



Relevant Pages

  • Re: recreate database script not work
    ... I got a script which is supposed to regenerate database systax. ... REM gen_dbse_9.sql ... end loop; ...
    (comp.databases.oracle.server)
  • Re: Loop Problem (At Least I think)
    ... If there are no images matching the product ... "" Then" statement (the one below the loop, outside of it), is this just ... >> script to finish. ... > 2) Read the database table and acess the dictionary object for the ...
    (microsoft.public.scripting.vbscript)
  • Re: How to set up a global variable in a sub-routine?
    ... the 'global variables' are more like constants ... ... single script, I need a way to tell it only once where the file is and ... So, if you construct a loop with a loop variable, you ... >programmers avoid global variables completely. ...
    (perl.beginners)
  • RE: (Urgent) Create many txt files from tables with DTS Package
    ... when i run this script the error show: ... > How to loop through a global variable Rowset ... >> D.90.70.0002 Husain Djojonegoro BOARD OF COMMISSIONER ... >> D.50.04.0071 Putu Supertama Checker BI ...
    (microsoft.public.sqlserver.dts)
  • Re: WMI Timeout possible?
    ... In my case, they script just hangs, no errors, no warnings, nothing. ... > for each loop from a dictionary object. ... > fine...just this snag with the WMI timeout thing. ... > 3.4) compare collected data to preexisting data from the OLE source ...
    (microsoft.public.scripting.vbscript)