Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: CrystalReports
I created a report from a table named "Product_Order" with the following fields
 
secret_code
mem_name
mem_code
mem_chapter
trn_date
ar_no
or_no
pro_category
pro_sub_category
pro_code
pro_name
pro_qty
pro_cost
pro_price
total_cost
total_price
pay_mode
pay_terms
process_by
deliver_by
 

 
Now i needed to show report based on a group
 
NOTE: RC = REPORT COLUMN
 
Group 1 - Pro_Category: Has field "Pro_Category"
Group 2 - Pro_Name: Has the following fields below
 
RC 1 - Field: pro_sub_category
RC 2 - Field: pro_code
RC 3 - Field: pro_name
RC 4 - Formula Field: sum({product_order.pro_qty},{product_order.pro_name})
RC 5 - Field: pro_cost
RC 6 - Field: pro_price
RC 7 - Formula Field: {product_order.pro_price}-{product_order.pro_cost}
RC 8 - Formula Field: {product_order.pro_cost} * Sum ({product_order.pro_qty}, {product_order.pro_name})
RC 9 - Formula Field: {product_order.pro_price}*Sum ({product_order.pro_qty}, {product_order.pro_name})
RC 10 - Formula Field: RC9 - RC8
 
Task i can't do:
Summarize RC8, RC9 & RC10 based on Group 1 - Pro_Category.
Summarize ALL RC8, RC9 & RC10 - "Like a GRAND TOTAL SUMMARY"
 
In short i needed to summarize a summarized field.
 

You may see and download database file and screen shot at:
https://dl.dropbox.com/u/65392916/SAMPLE.zip[^]
 
Hope this is clear enough to understand.
Posted 22-Nov-12 16:23pm
JMAM648
Edited 24-Nov-12 6:00am
v2
Comments
Nelek at 24-Nov-12 12:06pm
   
I won't download any file sorry. You can try to find out the portion of code involve and post the relevant snippet here.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

After many attempts i managed to find an article that answers my question.

@reset
whileprintingrecords;

global numbervar GTotal:=0;
//place this in report header, or higher grou header as appropriate

@Eval

whileprintingrecords;

global numbervar GTotal:=GTotal + Sum( valuefield, groupfield);
// place this in group footer where your sum shows

@display
whileprintingrecords;

global numbervar GTotal;
//Place this in report or higher group footer
  Permalink  
Comments
Abhishek Pant at 24-Nov-12 15:51pm
   
can you share that link of that article here so that it can be useful for others.
JMAM at 24-Nov-12 23:16pm
   
http://scn.sap.com/thread/1938836

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Mobile
Web04 | 2.8.140926.1 | Last Updated 24 Nov 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100