Print Page | Close Window

Grouping Problem in crystal report

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=59
Printed Date: 16 May 2024 at 7:38pm


Topic: Grouping Problem in crystal report
Posted By: lily_mogra
Subject: Grouping Problem in crystal report
Date Posted: 15 Dec 2006 at 5:12am

Hi Guys,

I have one table order
 with two colums orderid and orderamount

orderid and orderamount
1000         $10
1000         $20
2000         $30
3000         $40
4000         $50
4000         $60

I want to display records in crystal report
OrderId       Sum of order amount
1000           $30
2000           $30
3000           $40
4000          $110

I have create formula for orderamount sum(orderamount,OrderId)
this crystal report group by orderId.
but i am not geting actual answer

Thanks in advance for help

Lancecoder


 




Replies:
Posted By: emoreau
Date Posted: 15 Dec 2006 at 5:24am
I see at least 2 way of doing it:
 
1. sum your data directly from your datasource:
     select orderid, sum(orderamount) as orderamount
     from YourTableName
     group by orderid)
 
2. in your report, have the orderid and orderamount fields in the details and sum your amounts grouped by the order id but suppress the Group header and the Details sections so that you will only see the group footer.


-------------
HTH

Eric Moreau
MCSD, Visual Developer - Visual Basic MVP



Print Page | Close Window