Re: Help on creating this report

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Dorian,

The easiest way to do complicated reports is to pre-process the data exactly
the way you want it and then run the data from the temporary cursor you've
created.

To parse out the names in the Recip column I'd use the GetWordNum()
function. If you use "," for the delimiter parameter it will remove the
comma. I.e. GetWordNum(Recip, 2, ",") Then I'd use a Union query to add the
second name to the cursor of the first name.

Create Cursor Test(Document C(4), Recip C(20), Name C(10))
Insert Into Test Values ("Doc1", "Sue", "Adams")
Insert Into Test Values ("Doc1", "Sue", "Adelt")
Insert Into Test Values ("Doc1", "Sue, Nancy", "Adams")
Insert Into Test Values ("Doc1", "Sue, Nancy", "Carlton")
Insert Into Test Values ("Doc2", "Sue", "Bolts")

*--
Select ;
Document, ;
Padr(Alltrim(GetWordNum(Recip, 1, ",")), 10) As Recip, ;
Name ;
>From Test ;
Union ;
Select ;
Document, ;
Padr(Alltrim(GetWordNum(Recip, 2, ",")), 10) As Recip, ;
Name ;
>From ;
Test ;
Where ;
Not Empty(GetWordNum(Recip, 2, ",")) ;
Into Cursor ;
ReportCursor ;
Order By ;
2, 1, 3
*--

What I don't understand is the significance of the A, B, C columns for Sue
and the B, C, D columns for Nancy.


--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
cindy_winegarden@xxxxxxx www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"Dorian Chalom" <DChalom@xxxxxxxxxxx> wrote in message
news:%23ZdpVfncFHA.3060@xxxxxxxxxxxxxxxxxxxxxxx
>I have a data file of:
>
> Document Recip Name
> Doc1 Sue Adams
> Doc1 Sue Adelt
> Doc1 Sue, Nancy Brigs
> Doc1 Sue, Nancy Carlton
> Doc2 Sue Bolts
>
> and I would like to create a report like:
> Sue
> A B C
> Doc1 2 1 1
> Doc2 1
>
> Nancy
> B C D
> Doc1 1 1
>
> For reasons beyond my control the recip column has to have multiple names
> in it and I can create on record for each.
>
> TIAFYH (Thanks In Advance For Your Help)
>
>
>


.



Relevant Pages

  • Re: Help on creating this report
    ... is the first letter of the Name column. ... The names in the Recip column are not constant or consistant in the number ... > The easiest way to do complicated reports is to pre-process the data ... > the second name to the cursor of the first name. ...
    (microsoft.public.fox.vfp.reports.printing)
  • Re: ADO is slow with AS/400 Database
    ... it says "current record type does not ... reports, the performance is acceptable, but for larger query, its a ... I assume you are using a client-side cursor with your ADODataSet. ... accounts for the memory consumption when the query returns many rows ...
    (borland.public.delphi.database.ado)
  • Re: Another drm/dri lockup - when moving the mouse
    ... >> In previous reports I found that starting xfree or xorg with dri support ... The cursor was definitely SW, ... > to be related to dri ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: FPD report help
    ... the totals in it. ... INTO CURSOR yourcursor and then doing an INSERT INTO yourcursor ... > asked to modify a couple of the PRG-generated reports. ... > with a satisfactory solution. ...
    (microsoft.public.fox.programmer.exchange)
  • Re: ORATCL help needed!
    ... I am unable to use Oratcl 4.4 because it reports a nasty application ... select list" whenever I change the sql select string and use the SAME ... set cursor ...
    (comp.lang.tcl)