Need Urgent Help with Visual FoxPro Report!

Need Urgent Help with Visual FoxPro Report!

Post by Diane L. Emmi » Mon, 16 Sep 1996 04:00:00



I am trying to create a financial report for a client using Visual
FoxPro which shows Revenues and Expenses.  Easy enough.  The problem is
that when totalling Total Revenues or Total Expenses, not every item is
included in the Totals.

The tables are set up like this:

Description  - describes the item - Sales, Telephone Expense, etc.
Code - specifies whether it is a Revenue or an Expense
Amount - self-explanatory

Object Code - this is where we determine if it is included in the      
        Totals - if the object code begins with a 0 it is supposed to  
        be included in Total Revenues, else if the object code begins
        with anything else, it is to be included in Total Expenses

How would I do this on my report, i.e., if object code begins with 0 -
Total Revenues, else include in Total Expenses.

Thanks in advance.

Diane Emmich

 
 
 

Need Urgent Help with Visual FoxPro Report!

Post by Bill Morri » Mon, 16 Sep 1996 04:00:00



> I am trying to create a financial report for a client using Visual
> FoxPro which shows Revenues and Expenses.  Easy enough.  The problem is
> that when totalling Total Revenues or Total Expenses, not every item is
> included in the Totals.

> The tables are set up like this:

> Description  - describes the item - Sales, Telephone Expense, etc.
> Code - specifies whether it is a Revenue or an Expense
> Amount - self-explanatory

> Object Code - this is where we determine if it is included in the
>         Totals - if the object code begins with a 0 it is supposed to
>         be included in Total Revenues, else if the object code begins
>         with anything else, it is to be included in Total Expenses

> How would I do this on my report, i.e., if object code begins with 0 -
> Total Revenues, else include in Total Expenses.

> Thanks in advance.

> Diane Emmich

create 2 report variables:

1. total_expenses
        a. initial value = 0
        b. value to store = [iif( object_code = '0', 0, object_code)]
        c. calculate = Sum
2. total_revenues
        a. initial value = 0
        b. value to store = [iif( object_code = '0', object_code, 0)]
        c. caluculate = Sum

print the variables in the summary or other group band

Bill