简体   繁体   中英

Creating Sub Reports Total And Grand Total In Crystal Report

I have a Crystal Report getting data from SQL Server. I want to generate GroupReport Total and also Generate Grand Total Report

I have been able to generate the report from SQL, the following are the fields i have: Item_Name, qty, Price, Amount

I have created a Formular to sum all the amount which the total will give me the GrandTotal

But for each subreport, i want to get the total amount too but this seems to be operating in a running total form.

Below is what i am getting now.

OrderDate        Item     qty  Price    Amount
2019-07-24       rice      2   3,000    6,000
2019-07-24       beans     2   5,000    10,000
2019-07-24       fish      2   3,000    6,000

sub_Total        22,000

OrderDate        Item    qty  Price    Amount
2019-07-25       rice      2   3,000    6,000
2019-07-25       beans     2   5,000    10,000
2019-07-25       fish      2   3,000    6,000

sub_Total        44,000

OrderDate        Item    qty  Price    Amount
2019-07-26       rice      2   3,000    6,000
2019-07-26       beans     2   5,000    10,000
2019-07-26       fish      2   3,000    6,000

sub_Total        66,000


GrandTotal     66,000

tonumber({DTtablesales.Amount})

The below is how i want the report to be

OrderDate        Item    qty  Price    Amount
2019-07-24       rice      2   3,000    6,000
2019-07-24       beans     2   5,000    10,000
2019-07-24       fish      2   3,000    6,000

sub_Total        22,000

OrderDate        Item    qty  Price    Amount
2019-07-25       rice      2   3,000    6,000
2019-07-25       beans     2   5,000    10,000
2019-07-25       fish      2   3,000    6,000

sub_Total        22,000

OrderDate        Item    qty  Price    Amount
2019-07-26       rice      2   3,000    6,000
2019-07-26       beans     2   5,000    10,000
2019-07-26       fish      2   3,000    6,000

sub_Total        22,000


GrandTotal     66,000

Note that the GrandTotal is a TotalRunning Field calculating sum(Amount)

My problem is getting the sub-total

Try the Reset option on the subtotal under Edit Running Totals menu and reset at the correct group.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM