Report Printing from @key / input processing

John Esak john at valar.com
Tue Aug 29 13:57:18 PDT 2006


	Usually, when there is a number of records I want printed for each of a
single header record (or multiple header records)... I would use a loop and
not use an array. I would make sure the output form data area had only
variables in the data area like this:


Special Report Of Items Per Customer                           Date: *@td
*bd      to *ed                                                Page: <@pn


Customer               Date          Inv#         Amount
========================================================
*cu
                       *dt           *in          *am


Then, the processing looks something like this:


         if: oo ne 3  'old value is not equal to customer code field
       then: oo(6,.0,g)=3;  cu(6,.0)=3
         if:
       then: dt(8,mdy/)=4;  in(6,.0)=5;  am(9,.2)=6
       then: print;  cu="";  end

Run the report selecting the CU (or CU's) that you want, but be sure to use
an index that is based on CU (your unique code for the individual's
records). Something like this:

    .../dreport cusfile -f format -s sel_cust -iB -u

(where index.B is built on cust code (and maybe date as a second key)

If this is a header detail file and the header contains the unique code CU,
you must do this same thing with a looped lookup. In which case you don't
have to do the global variable which holds the unique code. It can be a
non-global value. Something like this.



       then: lookup cus_code=inv_file k=3 i=A -nx
loop     if: not cus
       then: end
         if: cus(1) ne 3  'if the detail record does not match the unique
value
       then: end
         if: oo(6,.0) ne 3
       then: oo(6,.0)=3;  cu(6,.0)=3
       then: dt(8,mdy/)=inv_file(4);  in(6,.0)=inv_file(5);
am(9,.2)=inv_file(6)
       then: print;  cu=""
       then: getnext inv_file;  goto loop

Run the report selecting the CU  (CU's) that you want.

    .../dreport cusfile -f format -s getcus -u



These code snippets will work for any number of records attached to a unique
code.

You can add some other dummy variables to print the subtotals for each
unique CU... They can be filled, printed and cleared when the OO value
changes. (but don't do this the time OO changes from "null" to something on
the first record. If you want to see this code, let me know, I'll put it up.


John


      > -----Original Message-----
> From: filepro-list-bounces+john=valar.com at lists.celestial.com
> [mailto:filepro-list-bounces+john=valar.com at lists.celestial.com]On
> Behalf Of Richard Tartaglia
> Sent: Tuesday, August 29, 2006 12:45 PM
> To: Fplist
> Subject: Report Printing from @key / input processing
>
>
> I hope all is good with everyone.
>
> FP 5.0.14  Windows
>
>
> I have many records in my database that connect to one
> person. Some may have 100 individual records. I am
> trying to print a report from @key processing listing
> records that pertain to that person.
>
> I can get all the data from the records in an array
> but when I try to get that data to paper I haven’t had
> any luck.
>
> My first question is, can this be done?
> If it is possible to do could someone please point me
> in the right direction? My hair is getting to thin to
> pull any more out.
>
>
> Thanks
> Rich Tartaglia
>
> The old guy in Virginia playing with his toys.
> http://www.masscollector.com/Race1.html
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list



More information about the Filepro-list mailing list