Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sub Total Question
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01084970
Message ID:
01085164
Vues:
16
Here's one way to do this.

1. Create a separate cursor using SELECT, SUM(), and GROUP BY to get the subtotal results.

2. Scan through the new cursor building three character strings with the values and CHR(13)+CHR(10) separating each one.
cRate = ""
cWork = ""
cAmt = ""
SELECT MyCursor
SCAN
  cRate = cRate + MyCursor.Rate + CHR(13)+CHR(10)
  cWork = cWork + MyCursor.Work + CHR(13)+CHR(10)
  cAmt = cAmt + TRANSFORM(MyCursor.Amt, '$$$,$$$,$$$.99') + CHR(13)+CHR(10)
ENDSCAN
3. In the summary band of the report place the cRate, cWork, and cAmt fields next to each other. Define them one line tall, but mark them as Stretch with overflow.

4. Run the report.


This keeps the report flexible and doesn't require changes whenever new types are added to the report. You just have to be careful that you define the fields wide enough to hold each field. Otherwise, if one description wraps to the next line the rest of the descriptions and amounts are all off.



>I am having trouble with the design of a particular report. This report is used as a job time sheet and is sent to customers with a copy of the bill. This report contains the following information Employee, Rate Type, Work Type, Day of the week, total rate and cost. The report is sorted by Date + Employee + Rate Type + Work Type. The report detail is lists as follows: Name (Employee Name), Rate Type (Type of Rate assigned such as In Shop, Off Site, Torch and Bid), Work Type (REG or OT), Thur, Fri, Sat, Sun, Mon, Tue, Wed, Total, Rate and cost. I have been able to create this report with one exception. The customer would like a total of each Rate Type + Work Type combination at the end of the report. I could do this by hard coding the value for the Rate Type field but I would rather not. These values can be defined by the users via master files and my change over time. I would like to come up with a solution that would allow them the flexibility of defining their own Rate Types without
>breaking the report. I am looking to display the totals similar to the following example:
>
>InShop OT 999,999.99
>InShop REG 999,999.99
>Torch REG 999,999.99
>Offsite OT 999,999.99
>Offsite REG 999,999.99
>BID REG 999,999.99
>
>They don’t necessarily need to be in this order, just a total of all printed combinations at the end of the report. Any help would be greatly appreciated.
Cathy Pountney, Microsoft Visual FoxPro MVP
Memorial Business Systems, Inc. (www.mbs-intl.com)

My Website: (www.frontier2000.com)
My Blog: (www.cathypountney.blogspot.com)
My Book: The Visual FoxPro Report Writer - Pushing it to the Limit and Beyond
Free MSDN Article: What's New in the VFP 9.0 Report Writer
Free MSDN Article: The VFP 9.0 Report Writer In Action
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform