Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Total Due in Group Header of Statement Report
Message
From
28/04/1998 13:14:58
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00095431
Message ID:
00095466
Views:
27
>I am trying to create an "A/R Statement" Report. In the group header I have the customers name etc and the detail band has the individual invoices and in the group footer I have a field with a variable to sume the invoice amounts. This all works fine. I was wondering if there is any way to get this total of invoices on the group header. I want the portion that the customer sends in with the payment to have the total on it as well.
>
>Thanks,
>
>Paul
Paul,
In fact more than one way to do it. The tendency as I read through thread is using SQL. Well it's a good solution too. Then just run one SQL for sums into a true cursor and relate it to actual parent, child tables for details (to avoid another SQL pass).
* Parent table for group header - Linkkey,p1,p2...
* Child invoice table : Linkkey, s1,s2,...
* Par-child reltions already set
select linkkey, ;
    sum(s1) as s1total, ;
    sum(s2) as s2total, ;
    .... ;
    from invoice ;
    group by linkkey ;
    where .t. ;
    into cursor tcTempTotals
use dbf("tcTempTotals") in 0 again alias tcTotals
use in "tcTempTotals"
select tcTotals
index on linkkey tag linkkey
select parenttable
set relation to linkkey into tcTotals
modify report myreport  && Include in first run to easily add your sumfield
*report form myreport to ....
One pass SQL would be so complex for now.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform