Tips and Tricks
 Crystal Reports Forum : Crystal Reports 9 through 2020 : Tips and Tricks
Message Icon Topic: Subreport & Shared Variable Post Reply Post New Topic
Author Message
cvgalloway
Newbie
Newbie


Joined: 07 Jul 2008
Location: United States
Online Status: Offline
Posts: 4
Quote cvgalloway Replybullet Topic: Subreport & Shared Variable
    Posted: 09 Jul 2008 at 8:22am
I have a main report that has data from 2 years sales history - the main report is sorted by the sales from the most year by customer (group 1) then I'm using groupnumber to show the ranking.
Now, I want to show the previous year's ranking within the report as well.  I added a subreport and sorted the sales by the previous year and used the groupnumber to rank.
The I created a shared variable in my main report and added it to the subreport.
No, in section expert of the subreport I did the following
suppress > x+2
whileprintingrecords;
shared numbervar cust;
{table.customer} <> cust
 
I did this to suppress the customer data except for the data matching the customer in the main report
 
But, this is not suppressing correctly - it is still showing all the results from the subreport. 
 
Please Help!!
Thanks
Catherine
 
IP IP Logged
vallance
Newbie
Newbie
Avatar

Joined: 28 Jul 2008
Location: United States
Online Status: Offline
Posts: 12
Quote vallance Replybullet Posted: 28 Jul 2008 at 6:31pm

I think that the error lies in the place you put the function. Did you put it in the section expert of the Main report or the Subreport?

Maybe it will work differently if you put it in the main report or the subreport. That would be the first thing I try.
IP IP Logged
saoco77
Senior Member
Senior Member


Joined: 26 Jun 2007
Online Status: Offline
Posts: 104
Quote saoco77 Replybullet Posted: 29 Jul 2008 at 5:47am
Have you linked the subreport to the main report??

Try linking the two by customer ID. This will create a selection formula by customer ID in the subreport.

You can create a link by right clicking on the subreport in the main report and selecting "Change subreport links"

Sarah
IP IP Logged
cvgalloway
Newbie
Newbie


Joined: 07 Jul 2008
Location: United States
Online Status: Offline
Posts: 4
Quote cvgalloway Replybullet Posted: 29 Jul 2008 at 6:13am
I was able to get the report to work.
The shared variable should only be placed in the subreport - not in the main report.
 
Thanks for the input.
Catherine
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.063 seconds.