Hi Victor,

the report "--parallel--" following below
has this structure
(best view with monospaced font):

----- FIRST PAGE HEADER
      - ask start date
      - ask end date
      - set rv99=0
----- OTHER PAGE HEADER
----- TWO-LEVEL REPORT HEADER
----- REPORT BODY
      +- virtual subreport 1 : LEGAL AREAS
      |  ...
      |  two-level etc.
      |  ...
      +- END OF SUBREPORT

      +- virtual subreport 2 :  HOW HEARD
      |  ...
      |  two-level etc.
      |  ...
      +- END OF SUBREPORT

      .... further subreports

      Stop [Sub]Report if 0 Is in Report Variable 99
----- TWO-LEVEL FOOTER
----- PAGE FOOTER
----- FINAL FOOTER


It produces this output:

      Start Date: 01011901
        End Date: 12122012


      --- Subreport 1 : LEGAL AREAS ---

      Consumer/contract       1
      Landlord/Tenant         1

      --- Subreport 2 : HOW HEARD ---

      Existing client 1
      Internet Search 1
      Total number seen in 01011901 to 12122012:      2

      --- Subreport 3 : # of cases / date ---

      15 July 2009      2
      Total number seen in  1 January 1901 to 12 December 1900:      2

      --- Subreport 4 : By date, then problem area with client name ---


      15072009
      Consumer/contract         (Smith)
      Landlord/Tenant           (Brown)
      Number of clients seen at this session:      2


Report "--parallel-- :

REPORT.BASED.ON.PANEL:1
NAME:~--parallel--~
REPORT.MODE:WP
OUTPUT.FILENAME:~PARALLEL.WPD~
CREATE.DISK.FILE
REPORT.INDEX: 1
TEXT.LINES=54 TOP.MARGIN=6 BOTTOM.MARGIN=0 LEFT.MARGIN=0
REPORT.FORM:
FIRST.PAGE.HEADER
 CR
PROMPT.FOR.VALUE.OF.RV:1 USING.FORMAT:~DDDMMYYYY~
  PROMPT.MSG:~Start Date~
PROMPT.FOR.VALUE.OF.RV:2 USING.FORMAT:~DDDMMYYYY~
  PROMPT.MSG:~End Date:~
SET.RV:99 FORMULA:~0~
FORMULA.END;
 CR
~Start Date: ~ RV:1;~DDDMMYYYY~  CR
~  End Date: ~ RV:2;~DDDMMYYYY~  CR
OTHER.PAGE.HEADER
TWO.LEVEL.REPORT.HEADER
REPORT.BODY
VIRTUAL.SUBREPORT.TO.PANEL:1 TO.INDEX:4 FIELD.LIST:0
FIRST.PAGE.HEADER
 CR
~--- Subreport 1 : LEGAL AREAS ---~  CR
TWO.LEVEL.REPORT.ON.FIELD:15
OTHER.PAGE.HEADER
TWO.LEVEL.REPORT.HEADER
REPORT.BODY
SET.RV:3 FORMULA:~If ~  FIELD=P1F14 ~>=rv1 and ~  FIELD=P1F14
~<=rv2 then 1 else 0 endif~
FORMULA.END;
SKIP.RECORD.ON.RV:3
TWO.LEVEL.FOOTER
 FIELD=P1F15;~A25;;T~ ~ ~
PRINT.CNTRL.STRING: 204 10 15 204 RECORD:~GZZZZZ9;;B~
PAGE.FOOTER
FINAL.FOOTER
END.SUBREPORT.FOR.PANEL:1
VIRTUAL.SUBREPORT.TO.PANEL:1 TO.INDEX:3 FIELD.LIST:0
FIRST.PAGE.HEADER
 CR
~--- Subreport 2 : HOW HEARD ---~  CR
TWO.LEVEL.REPORT.ON.FIELD:13
OTHER.PAGE.HEADER
TWO.LEVEL.REPORT.HEADER
REPORT.BODY
SET.RV:3 FORMULA:~If ~  FIELD=P1F14 ~>=rv1 and ~  FIELD=P1F14
~<=rv2 then 1 else 0 endif~
FORMULA.END;
SKIP.RECORD.ON.RV:3
TWO.LEVEL.FOOTER
 FIELD=P1F13;~A30;;T~
PRINT.CNTRL.STRING: 204 10 15 204 RECORD:~GZZZZZ9;;B~ ~ ~
PAGE.FOOTER
FINAL.FOOTER
~Total number seen in ~ RV:1;~DDDMMYYYY~ ~ to ~ RV:2;~DDDMMYYYY~ ~: ~
RECORD:~GZZZZZ9~
END.SUBREPORT.FOR.PANEL:1
VIRTUAL.SUBREPORT.TO.PANEL:1 TO.INDEX:5 FIELD.LIST:0
FIRST.PAGE.HEADER
 CR
~--- Subreport 3 : # of cases / date ---~  CR
TWO.LEVEL.REPORT.ON.FIELD:14
SET.RV:102 FORMULA:~apply.format["GZ9";day[rv1]]" "~  CR
~(month[rv1] cases~  CR
~case cv=1 of "January" endof~  CR
~case cv=2 of "February" endof~  CR
~case cv=3 of "March" endof~  CR
~case cv=4 of "April" endof~  CR
~case cv=5 of "May" endof~  CR
~case cv=6 of "June" endof~  CR
~case cv=7 of "July" endof~  CR
~case cv=8 of "August" endof~  CR
~case cv=9 of "September" endof~  CR
~case cv=10 of "October" endof~  CR
~case cv=11 of "November" endof~  CR
~case cv=12 of "December" endof~  CR
~endcases)" "~  CR
~apply.format["N9999";year[~ ~rv1]]~  CR

FORMULA.END;
SET.RV:103 FORMULA:~apply.format["GZ9";day[rv2]]" "~  CR
~(month[rv2] cases~  CR
~case cv=1 of "January" endof~  CR
~case cv=2 of "February" endof~  CR
~case cv=3 of "March" endof~  CR
~case cv=4 of "April" endof~  CR
~case cv=5 of "May" endof~  CR
~case cv=6 of "June" endof~  CR
~case cv=7 of "July" endof~  CR
~case cv=8 of "August" endof~  CR
~case cv=9 of "September" endof~  CR
~case cv=10 of "October" endof~  CR
~case cv=11 of "November" endof~  CR
~case cv=12 of "December" endof~  CR
~endcases)" "~  CR
~apply.format["N9999";year[rv3]]~  CR

FORMULA.END;
OTHER.PAGE.HEADER
TWO.LEVEL.REPORT.HEADER
REPORT.BODY
SET.RV:3 FORMULA:~If ~  FIELD=P1F14 ~>=rv1 and ~  FIELD=P1F14
~<=rv2 then 1 else 0 endif~
FORMULA.END;
SKIP.RECORD.ON.RV:3
SET.RV:101 FORMULA:~apply.format["GZ9";day[~  FIELD=P1F14 ~]]" "~  CR
~(month[~  FIELD=P1F14 ~] cases~  CR
~case cv=1 of "January" endof~  CR
~case cv=2 of "February" endof~  CR
~case cv=3 of "March" endof~  CR
~case cv=4 of "April" endof~  CR
~case cv=5 of "May" endof~  CR
~case cv=6 of "June" endof~  CR
~case cv=7 of "July" endof~  CR
~case cv=8 of "August" endof~  CR
~case cv=9 of "September" endof~  CR
~case cv=10 of "October" endof~  CR
~case cv=11 of "November" endof~  CR
~case cv=12 of "December" endof~  CR
~endcases)" "~  CR
~apply.format["N9999";year[~  FIELD=P1F14 ~]]~  CR

FORMULA.END;
TWO.LEVEL.FOOTER
RV:101;~A25;;T~ ~ ~ RECORD:~GZZZZZ9~
PAGE.FOOTER
FINAL.FOOTER
~Total number seen in ~ RV:102;~A25;;T~ ~ to ~ RV:103;~A25;;T~ ~: ~
RECORD:~GZZZZZ9~
END.SUBREPORT.FOR.PANEL:1
VIRTUAL.SUBREPORT.TO.PANEL:1 TO.INDEX:8 FIELD.LIST:0
FIRST.PAGE.HEADER
 CR
~--- Subreport 4 : By date, then problem area with client name ---~  CR
TWO.LEVEL.REPORT.ON.FIELD:14
OTHER.PAGE.HEADER
TWO.LEVEL.REPORT.HEADER
 CR
BOLD.ON  FIELD=P1F14;~DDDMMYYYY~
BOLD.OFF
REPORT.BODY
SET.RV:3 FORMULA:~If ~  FIELD=P1F14 ~>=rv1 and ~  FIELD=P1F14
~<=rv2 then 1 else 0 endif~
FORMULA.END;
SKIP.RECORD.ON.RV:3
 FIELD=P1F15;~A25~ ~ (~  FIELD=P1F3;~A50;;T~ ~)~
TWO.LEVEL.FOOTER
~Number of clients seen at this session: ~ RECORD:~GZZZZZ9~
PAGE.FOOTER
FINAL.FOOTER
END.SUBREPORT.FOR.PANEL:1
STOP.REPORT.ON.RV:99
TWO.LEVEL.FOOTER
PAGE.FOOTER
FINAL.FOOTER
REPORT.END;


To import this report into your database, follow Ralph Alvy's
instructions on page 408 (importing reports).
(As always - first back up your database.)

Good days,
Hans





On Sat, 25 Jul 2009 20:22:49 +0100, Victor Warner <[email protected]> wrote:

>
> I have a simple database to record clients who visit a free legal advice
> clinic I volunteer at.
>
> The database records the
>
> 1. name of the client
> 2. date of their visit
> 3. the legal area of their problem
> 4. How they heard of us
> 5. other details
>
> Currently I produce three reports
>
> 1. A two level report showing for each period, for each legal area the
> number of clients needing this help:
>
> eg
> Employment 3
> Housing 4
> Consumer 5
> etc
>
> 2. a two level report showing for each period, how clients heard of us
>
> eg
> CAB 5
> Existing client 5
> Internet search 5
> etc
>
> 3. a two level report, showing for a period, how many clients came each
> week:
> eg
> 01/07/2009 5
> 15/07/2009 5
> 22/07/2009 7
> etc
>
> Each one has appropriate indexes to create the two level report desired
>
> I have no problem producing these as individual reports. What I would
> like to do is produce one report using virtual link sub-reports (ie
> parallel sub-reports, to use Ralph Alvy’s terminology), so that I select
> the start and end date once using Prompt for Value of Report Value.
> Again I have no problem with using this method and using the Skip To and
> Skip If iteration commands for an individual report, but doing 3
> parallel reports particularly where the two-level is not sorted on date,
> does not produce the desired result. It appears to be a problem with
> indexes, but despite reading the Iteration Control and Sub-report
> chapters in detail I cannot locate the problem or an example of what I
> want.
>
> A copy of the database is available for download at
> http://www.rlas.org.uk/Download/rlas-c3.zip. Example of each of 3
> reports are provided (created as individual reports)
>
> Help with this would be very much appreciated.
>
> Victor Warner

_______________________________________________
Dataperf mailing list
[email protected]
http://lists.dataperfect.nl/mailman/listinfo/dataperf

Reply via email to