Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run fast these codes for reports
Message
From
30/04/2005 11:35:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
How to run fast these codes for reports
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01009899
Message ID:
01009899
Views:
62
When i use to these codes in vf8 very good result(speed) but in vf9 very very slow. how can speed up these codes.
thanks
 monthfm=thisform.monthfm.value 
 monthto=thisform.monthto.value
 Select 6
 Set Order To code
 Set Filter To
 Replace dr With 0 All
 Replace cr With 0 All
 
 *Do While !Eof()
 LOCATE
 scan
     Replace dr With opdr
     Replace cr With opcr
    * Skip
* Enddo
endscan
 Select 6
 LOCATE
 scan
 *Do While !Eof()
     tcode = code
     Select 7
     Set Order To refno
     Set Filter To code=tcode and date<=thisform.adate.value AND BETWEEN(month,m.monthfm,m.monthto)
     Sum debit To mdr 
     Sum credit To mcr 
     Select 6
     Replace dr With dr+mdr
     Replace cr With cr+mcr
     *Skip
* Enddo
 *
 endscan
  
 *
 Select 6
 Set Order To lcode
 Set Filter To
 If !thisform.cfname.value=1
     Set Filter To code>=thisform.codefm.value and code<=thisform.codeto.value and sec>=thisform.secfm.value and sec<=thisform.secto.value and scode>=thisform.shiftfm.value and scode<=thisform.shiftto.value and lcode>=thisform.levelfm.value and lcode<=thisform.levelto.value and admtd=1 and !dr-cr=0
 Endif
 If thisform.cfname.value=1
     Set Filter To code>=thisform.codefm.value and code<=thisform.codeto.value and sec>=thisform.secfm.value and sec<=thisform.secto.value and scode>=thisform.shiftfm.value and scode<=thisform.shiftto.value and lcode>=thisform.levelfm.value and lcode<=thisform.levelto.value and admtd=1 and fname=thisform.fname.value
 Endif
 *Goto Top
locate
 Count To c
 If c>0
     Report Form (Alltrim(thisform.file.value)) Preview
     Do filter
 Endif
 If c=0
     = Messagebox('Data not found for Selected Critarea', 32, product)
     Return .T.
 Endif
Next
Reply
Map
View

Click here to load this message in the networking platform