Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to run fast these codes for reports
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01009899
Message ID:
01009928
Views:
20
>the 6 name is student and 7 name is account

Khuabaib,
This is example. You can add more fields in cursor from students in select for your report:
LOCAL add_if
monthfm=thisform.monthfm.value 
monthto=thisform.monthto.value

If !thisform.cfname.value=1
   add_if = "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"
ELSE
   add_if = "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

Select  student.code                     ,;
        student.lcode                    ,;
        SUM(account.debit)  + opdr AS dr ,;
        SUM(account.credit) + opcr AS cr  ;
  FROM  Student                           ;
  LEFT  JOIN Account ON Student.code = account.code;
  WHERE date<=thisform.adate.value AND BETWEEN(month,m.monthfm,m.monthto);
        AND &add_if;
  ORDER BY lcode;
  GROUP BY student.code,student.lcode;
  INTO CURSOR my_cursor
 
IF _TALLY > 0
   Report Form (Alltrim(thisform.file.value)) Preview
ELSE
   = Messagebox('Data not found for Selected Critarea', 32, product)
   Return .T.
ENDIF
_______________________________________________________________
Testing displays the presence, not the absence of bugs.
If a software application has to be designed, it has to be designed correctly!
_______________________________________________________________
Vladimir Zografski
Systems Analyst
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform