Hi
i want to generate report using these calculatins and data please see the text file
Dept_Code Product Prod_Code AreaName Quantity Price Amount Discount
1 Prod1 Prod100 India 5 2 10 5%
1 Prod1 Prod200 India 10 2 20 5%
1 Prod2 Prod300 India 5 3 15 6%
1 Prod2 Prod301 India 5 4 20 6%
2 Prood1 Prod25 Inda 10 3 30
2 Prod1 Prod26 India 5 5 25
2 Prod2 Prod27 India 5 4 20
2 Prod2 Prod28 India 2 5 10
and i want to calculate
according to Particular Product in one Dept_code
1 TotalAmount
2. discount value
1)TotalAmount of each Product in one Dept_Code:
2)Discount on each ProductsTotalAmount in one Dept_Code
(Discount of prod1 TotalAmount will be (5/100)*30
3)Calculate Net Total of Each Product(TotalAmount - Discount) or sum(NetTotal)
Dept_Code Product TotalAmount Discount NetTotal
1 Prod1 30 (5/100)*30 =1.5 30-(5/100)*30 = 28.5
1 Prod2 35 (6/100)*35 =2.1 35-(6/100)*35 = 32.9
And 2 nd part is
According to considering One Dept_Code and all Prodcuts
InvoiceTotal = Sum(TotalAmount)
InvoiceDiscount = Sum(Discount)
NetTotal = InvoiceTotal-InvoiceDiscount
Dept_Code InvoiceTotal DiscountTotal NetTotals
1 65 3.6 61.4
and at the end i want to combine all Dept_Code Calculations and show in report
And My Report shuld display like this:
InvoiceHeader
Department :Dept_Code
ProductName: Prod1
Prod_Code Date Quantity Price Amount
India Prod100 10-10-2012 5 2 10
India Prod200 9-10-2012 10 2 20
TotalAmount: 30.0
Discount: 1.5
NetTotal: 28.5
ProductName:Prod2
India Prod300 10-10-2012 5 3 15
India Prod301 9-10-2012 5 4 20
TotalAmount: 35.0
Discount: 2.1
NetTotal: 32.9
Invoice TOtals: 65.0
Discount : 3.6
Total : 61.4