Following Hilmar's advise, make all that configurable trough a parameters table.
As for reports, you can generate them dinamically using some tools as Doug Hennig's Report Class (available in the Downloads section or at
www.stonefield.com).
You can also check the various fameworks available for VFP. Most of them handle this kind of things.
Best luck,