Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Any idea on creating a semi-monthly report for time reco
Message
From
08/09/2003 02:58:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
08/09/2003 02:30:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00826971
Message ID:
00826987
Views:
26
>hi cetin,
>
>i already did that but i don't get any value for columns jan-june..
>
>the usual report we create is displayed in details row by row.. that is if i have field "empno" in my details band, all the employee nos. will be displayed from top to bottom.. now i would like to create a report that will display all vl and sl from left to right..
>
>is this possible?

I'm not still sure. You mean a crosstab ? This might help :
Create Cursor myCur ;
  (empno i, effectdate d, vl c(10), sl c(10))

For ix = 1 To 10
  For jx=1 To 6
    If Int(Rand()*1000)%3 = 0
      Insert Into myCur ;
        values (ix,Date(2003,jx,1),;
        'v_'+Padl(ix,2,'0')+'_'+Padl(jx,2,'0'),;
        's_'+Padl(ix,2,'0')+'_'+Padl(jx,2,'0'))
    Endif
  Endfor
Endfor

Select myCur
Index On empno Tag empno
lnMonths = 6
Dimension arrStruc[lnMonths*2+1,4]
arrStruc = 0
arrStruc[1,1] = 'empno'
arrStruc[1,2] = 'I'
arrStruc[1,3] = 4
For ix = 1 To lnMonths
  arrStruc[(ix-1)*2+2,1] = 'vl'+Padl(ix,2,'0')
  arrStruc[(ix-1)*2+2,2] = 'C'
  arrStruc[(ix-1)*2+2,3] = 10

  arrStruc[(ix-1)*2+3,1] = 'sl'+Padl(ix,2,'0')
  arrStruc[(ix-1)*2+3,2] = 'C'
  arrStruc[(ix-1)*2+3,3] = 10
Endfor
Create Cursor crsRep From Array arrStruc
Scatter To arrRec Blank
Select myCur
Scan
  arrRec[1] = empno
  Scan While empno = arrRec[1,1]
    lnMonth = Month(effectdate)
    arrRec[(lnMonth-1)*2+2] = vl
    arrRec[(lnMonth-1)*2+3] = sl
  Endscan
  Insert Into crsRep From Array arrRec
  arrRec = ''
  Skip -1
Endscan
Select crsRep
Browse
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform