Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing
Message
De
08/02/2009 23:58:21
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
08/02/2009 23:50:16
Muthu Vel
Sty Company
Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01380229
Message ID:
01380230
Vues:
49
>I have create 'student.dbf' with fields having namely 1. Regno 2.Name 3.class 4.community 5.Place.
>I have designed 'Print.scx' form, in that i have placed two text boxes namely 1. txtfrom 2. txtto and one command button namely 'cmdprint'.
>I want to print the student record what I enterd regno in txtfrom and txtto. for example I have enterd starting regno '11001' in txtfrom and ending regno '11020' in txtto and click the command button the printer print the records starting from 11001 to 11020.
>
>How to write code?

The best way to do this is to select the data first. Select to a cursor (temporary table). For example:
local lcFrom, lcTo
lcFrom = ThisForm.TxtFrom.Value
lcTo = ThisForm.TxtTo.Value
select * from student;
  where regno between lcFrom and lcTo;
  order by Regno;
  into cursor Temp
You must also create a report that prints the desired data. Assuming you already created your report, you can run it as follows:
* Preview, on screen
report form MyReport preview

* Or, print the report
report form MyReport to printer prompt
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform