| Author |
Message |
Elisha83
Groupie
Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
|

Topic: Show Total Sales value at main report Posted: 09 Dec 2008 at 3:05am |
Hi there~
I need some guidance on how I can get the Total Sales value at main report but the data retrieve from sub report.
Example:
Beauty & Skin Care
Shops Lot No Total Sales
Himalaya 101 100,000
Clarins 102 200,000
SK-II 103 300,000
BEAUTY & SKIN CARE TOTAL : 600,000
The Total Sales is the subreport. While the Blue colour value "600,000" is what I want to show in the main report.
Thanks in advance.
Regards,
Elisha
|
|
3Lish@
|
IP Logged |
|
|
|
rahulwalawalkar
Senior Member
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
|

Posted: 09 Dec 2008 at 5:33am |
Hi
Read Shared Variables in Crystal Reports help and passing data from subreport to Main report.
Subreport Create formula
WhilePrintingRecords; shared numbervar numvar; numvar := tonumber(Sum ({table.Last Year's Sales}, {table.groupfield}))
Main report create formula
WhilePrintingRecords; shared numbervar numvar;
Place the subreport just before you start printing main report to ge the correct values
Cheers
Rahul Edited by rahulwalawalkar - 09 Dec 2008 at 5:44am
|
IP Logged |
|
Elisha83
Groupie
Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
|

Posted: 15 Dec 2008 at 12:34am |
Hi Rahul,
I try the method that you gave me but it seems not correct. This is the output that I get.
Beauty & Skin Care
Shops Lot No Total Sales
Himalaya 101 100,000
Clarins 102 200,000
SK-II 103 300,000
BEAUTY & SKIN CARE TOTAL : 300,000
It seems taken the last total sales only. Please advice on what I can do.
Thanks in advance~
Regards
Elisha
|
|
3Lish@
|
IP Logged |
|
rahulwalawalkar
Senior Member
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
|

Posted: 15 Dec 2008 at 2:07am |
Hi
Are you calculating sum of Total Sales in your subreport,you need to pass sum of totalsales to main report.
cheers
Rahul
|
IP Logged |
|
Elisha83
Groupie
Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
|

Posted: 15 Dec 2008 at 4:02am |
Rahul,
Yes, I did sum up the total sales in my subreport before i pass the value to the main report.
Im using the Shared Value function that you give me and apply it to the report. I do try also using the "Running Total Field" function and use the value to share out to the main report ,yet the output is still the same.
Any other way that I can do to get the right output?
Thanks & Regards,
Elisha
|
|
3Lish@
|
IP Logged |
|
rahulwalawalkar
Senior Member
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
|

Posted: 15 Dec 2008 at 4:33am |
How are you linking the subreport where is subreport placed ,please let me know
can you mail me your report
Cheers
Rahul Edited by rahulwalawalkar - 15 Dec 2008 at 4:43am
|
IP Logged |
|
Elisha83
Groupie
Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
|

Posted: 15 Dec 2008 at 8:34am |
Hi rahul,
I have send my report to your email. Do let me know if you didn't receive it.
Thanks a lot for your help. Really appreciate it. 
Regards,
Elisha
|
|
3Lish@
|
IP Logged |
|
rahulwalawalkar
Senior Member
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
|

Posted: 15 Dec 2008 at 1:38pm |
Hi Elisha,
In the main report you are grouping by StoreType for which you want Total Sales whereas in your subreport you are grouping by lease type,why don't you calculate the summary in the subreport for lease type itself......
As i don't have database ,i am not able to modiy the report......
cheers
Rahul
|
IP Logged |
|
Elisha83
Groupie
Joined: 19 Feb 2008
Location: Malaysia
Online Status: Offline
Posts: 62
|

Posted: 21 Dec 2008 at 11:57pm |
Hi Rahul,
I need to get the sum up total by storetype and not by each lease.Or do u think I need to add another group section for storetype inside the subreport?
Thanks & Regards,
Elisha
|
|
3Lish@
|
IP Logged |
|
rahulwalawalkar
Senior Member
Joined: 08 Jun 2007
Location: United Kingdom
Online Status: Offline
Posts: 731
|

Posted: 22 Dec 2008 at 2:00am |
Hi
Yes you can do that see if it is giving you the correct Group Total
Cheers
Rahul
|
IP Logged |
|
|
|