Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Filtering data to a report from a form
Message
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00542198
Message ID:
00542213
Vues:
20
IMO, the best way would be to use SQL select to build cursor for a report. After user enters all the conditions build the WHERE clause of the select and run it
lcWhere = [Status = "] + ALLTRIM(Thisform.txtStatus.Value) + ;
    [" And Saledate = {] + Transform(Thisform.txtSaledate.Value ) + [}]
Select * From Mytable ;
  Where &lcWhere ;
  Into Cursor ReportCursor
This way you can even allow a user to sort report in the different ways by building ORDER BY clause based on user input and including it into select. Make sure that your report doesn't have aliases included with field names.

>I want to filter the data in a report, to create various versions of data outout according to the filter creteria. I have a form that allows one to enter various filter criteria eg: sale date = 12/02/2001 or status = S and so on.
>
>How do I send these values to the report from the form, so that I can filter my data. I use the REPORT FORM command to call the report from the main form. I have tried using the command as follows: REPORT FORM myRep TO PRINTER FOR status = "S". However when I compile the form, it gives my a type mismatch error. Does the field status in my example have to be on the report I am calling?
>
>Is there any other way I can filter the data in the report. I do not want to create a different report for every filter condition.
--sb--
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform