Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Report Data Sources
Message
From
08/08/2000 19:43:29
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
 
 
To
08/08/2000 19:08:13
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00402582
Message ID:
00402589
Views:
10
Kris,

Have the user input dFromDate and dToDate on a form and then hit the "go" button. In the "go" button, call this code:
*!* dFromDate = THISFORM.txtFromDate.Value
*!* dToDate   = THISFORM.txtToDate.Value

SELECT dMyDate, COUNT(*) AS nNumberOfRecords, SUM(Amount) AS nTotalAmount ;
    FROM MyTable ;
    INTO CURSOR ReportCursor ;
    WHERE BETWEEN(dMyDate, dFromDate, dToDate) ;
    GROUP BY dMyDate

REPORT FORM MyReport TO PRINTER NOCONSOLE
USE IN ReportCursor    && Close cursor if you're not using it again.
Now, save ReportCursor on your hard drive while you get the layout of your report finished. Don't put anything in the data environment. Refer to the data in the report controls as MyField, not MyCursor.MyField. When your app is running, if you run the report right after the cursor is created, the cursor will be the current work area.




>I am relatively new to database programming and need to know how to make a report work in FoxPro. I have a table with a date field and an amount field. My goal is to create a report that will let me select a date range and print the total number of records and a sum of the amount fields for EACH DAY within that range.
>
>I was thinking about using a Select - SQL statement to retrieve the information into a temporary cursor and then work with it from there using report variables.
>
>Am I on the right track?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform