Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Total Minutes to Hours Minutes in Report Group
Message
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00341419
Message ID:
00341673
Views:
24
>John,
>
>I didn't know you could add a function to a report. That will solve a lot of problems for me. How is this accomplished?

Alan,
I always start my programs from a prg. That prg runs the first form but also has any number of functions/procedures in it. (The terms procedure and function can be used intgerchangeably in FoxPro.) When you run your report the procedures are avalable. You can also have any number of procedure files. I have a standard jsmain.prg that I start all programs with. It has all my standard functions such as the one you would write to convert minutes to hours. For example I have one I call time12() that converts a 24 hr clock to am/pm and formats it. I then make another procedure file that holds all the common procedures needed for a perticular application. This might include a perticular way to calulate an employee's pay that is needed in a number of places in the program.
It all looks something like this:

* JSMAIN.PRG
* -------------
* startup code such as
clear all
close all
set talk off
etc...
* --------
* include the procedure files
set procedure to jsmain, appstuff
* --------------------
* run the opening form of the system
do form main.scx

*
* ---------------------
* start of common procedures
PROCEDURE MinToHours
LParamters mMinutes
*
local mretval = ''
* put your calculations here and put the final answer in mretval

RETURN mretval

* ---------------------------------------------

Now in your report you can simply put MinToHrs(minutes)
in the report expression where you want the conversion. minutes is the value you want to convert

Hope this helps. If you still have problems let me know.
Beer is proof that God loves man, and wants him to be happy. - Benjamin Franklin
John J. Henn
Previous
Reply
Map
View

Click here to load this message in the networking platform