Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreports issue Post Reply Post New Topic
Page  of 2 Next >>
Author Message
visit2me
Newbie
Newbie
Avatar

Joined: 11 Aug 2010
Location: United States
Online Status: Offline
Posts: 10
Quote visit2me Replybullet Topic: Subreports issue
     Posted: 28 Jun 2011 at 6:32am
Hi All, I have two subreports that i am placing on main report footer. My both subreports are calclulating Inventory quantities of different size like 2cm and 3 cm.I am doing this 2 subreports because my data are in rows in my universe and I need to display those data in columns on my report. I have sort of completely done my report except couple of issues.
My first Issue: I need to get a column of total quantity of both of these subreports quantities. I tried shared variable but can't get it to work. Please suggest me if there are other way to accompolish my goal.

2nd issue: I need to display a column for ranking in main report. And this ranking is base on avearage Sales amount of inventories sold. Tried this also with shared variable can't get it to work. Please suggest me any other ways.

Thanks in advance
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 6:47am

you could use a crosstab to display in columns but as for the totals you can use shared varaibles from sub to main reports but you cannot use the data from the sr in or above the section that the sr resides on.basically your totals from sr1 and sr2 have to be in a 3rd footer RFc

IP IP Logged
visit2me
Newbie
Newbie
Avatar

Joined: 11 Aug 2010
Location: United States
Online Status: Offline
Posts: 10
Quote visit2me Replybullet Posted: 28 Jun 2011 at 6:59am
Thank you, DBlank for quick response. I tried cross-tab too. My issue with cross tab was again couple of more calculated fields that i need to add for each size 2cm and 3cm. Or simply the format that i have for the report, cross-tab doesn't support. Though cross -tab is great to display row data into column information.

My data in subreport is on GF1 for both. And I have inserted a new report footer in my main report where i placed my shared variable but doing so I only see only last record from each subreport. Which is not really I wanted to see. I wanted to see each total for each record that subreport returns in main report. what do you think I am missing to do that this shared variable is not returning all records.

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 7:09am
yes you will need 2 shared variables (1 per sr)
in the sr you need to set the value of each variable to the total value from that sr and then in the main report that is what will be passed and displayed


Edited by DBlank - 28 Jun 2011 at 7:09am
IP IP Logged
visit2me
Newbie
Newbie
Avatar

Joined: 11 Aug 2010
Location: United States
Online Status: Offline
Posts: 10
Quote visit2me Replybullet Posted: 28 Jun 2011 at 7:18am
DBlank, this is the formula I have in my each subreport.
First subreport:
formula Test1:
sum({23051.Pricing Quantity},{23051.Item Description})
formula Test2:
Shared numbervar Amount1;
Amount := {@test1};
2nd subreport:
formula Test3:
sum({23051.Pricing Quantity},{23051.Item Description})
formula Test4:
Shared numbervar Amount2;
Amount2 := {@test3};

And in my main report. I have formula placed in 2 report F.
formula name test 5:
shared numbervar Amount1;
Amount1
formula name test6
shared numbervar Amount2;
Amount2

What do you think need change in my above formula?

Edited by visit2me - 28 Jun 2011 at 7:20am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 7:40am
sr1 test1
shared numbervar x;
x:=sum({23051.Pricing Quantity},{23051.Item Description})
 
mr test1
shared numbervar x;
x:=x
 
sr2 test2
shared numbervar y;
y:=sum({23051.Pricing Quantity},{23051.Item Description})
 
mr test2
shared numbervar y;
y:=y
 
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 7:41am
note i don't like variables, i prefer running totals (which won't work here) so I hope I got this correct
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Jun 2011 at 7:45am
what is it displaying?
 
I am guessing that it is displaying the value of the last group, as that is what you telling it to do.
 
Is this what you wanted?  If you want a total for all the counts, remove the group option.
 
I know that you wanted to use these numbers to adjust the sorting of the various groups, but I don't think that is possible...you could do it in a stored proc, but not directly in CR.
 
HTH
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 7:47am
thanks lockwelle!
didn't even notice the grouping when I copied and pasted  Wacko
IP IP Logged
visit2me
Newbie
Newbie
Avatar

Joined: 11 Aug 2010
Location: United States
Online Status: Offline
Posts: 10
Quote visit2me Replybullet Posted: 28 Jun 2011 at 8:18am
Thank you DBlank for formula correction but it seems that your formula is doing same thing like mine did. So, it didn't work.
IP IP Logged
Page  of 2 Next >>
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