Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Subreports issue Post Reply Post New Topic
<< Prev  Page  of 2
Author Message
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:22am
Thank you lockwelle for you input, the above formula displays only the sum last count of the group. I wanted to display the total of each row record from 2cm and 3cm subreports to display in main report otherwise, have shared variable from each subreport for each row/record and then call these both shared varible from subreports to main report and display for each record. I don't know if this doable.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 8:38am
as lockwelle noted the shared variable formulas are giveing the sum at the group level, if you remove the group portion for each it will give you the sum for each sub report (all rows)
X:=sum({23051.Pricing Quantity})
y:=sum({23051.Pricing Quantity})
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:58am
I agreed with both of you but I have multiple record for each item. I need a group in subreport. if i were to remove the group from formula then i will give me total sum of all records. Not individual sum for each record.
Let me show you my report format:

                   2cm                 3cm           2+3
        Item          Mdl   Tot          Mdl Tot   Tot
Rank Des    Inv. Inv. Inv.   Inv. Inv. Inv Inv.
1     abc       5     9    14      3     5    8      22
2     def       6     2     8       9    2    11     19
-     --       --
-     ---      --
-     ---

My biggest issue is my data are in rows in universe. Now my report format looks like above. Cross tab doesnt work because of calculated fields like Mdl. Inv. and Total Inv. or 2+3 Total Inv.
therefore, I created two subreports displaying 2cm and 3 cm information. I am placed both sub reports in main report without any group on report footer.
My issue is Rank column, which i need to calculate base on average sales dollar (Which is price field and i didn't mention that field in format because that is not necessary to display) and last column Total 2 + 3cm (which i need to added each line from both subreport).
Is this doable?

Edited by visit2me - 28 Jun 2011 at 9:19am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 9:07am
so you have 2 sideby side subreports and you want to show a 'row' based total of the 'rows' in each iof the sub-reports.
Is that accurate?
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 9:12am
You got it 100% right. Is this doable? My analysts wants this format only.
My Ranking is base on the Total Amount sales of inventory.
I know , I haven't list anything regarding amount in the report format. But if somehow I can figure out the 2 + 3 cm total column then i can apply same logic to Ranking too.

Edited by visit2me - 28 Jun 2011 at 9:22am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 9:26am
Yuck.
not really doable as you have it.
I apologize as I assumed you had 2 subreports and were looking to pull a total at the end like a ledger.
As for the ranking you can use TOP N grouping and sorting with no subreports to get the order of the records as you are doing in a subreport.
Lockwelle would likely suggest doing it all in stored procs and uing that as your source which is a nice solution too.
I think you can likely use grouping with underlay options and a few formulas to get your rows into a coulmn like format that...


Edited by DBlank - 28 Jun 2011 at 9:27am
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 9:34am
I know BDlank, Yuck.
I said same to myself at begining. but thanks alots for suggesting various ways both you and Lockwelle.
My developer doesn't want to modify universe base on individual report requirements. I guess, DBlank, you are right for doing Ranking the way you suggested and I had that in mind too.
I will play around and will see if i can get it to work. If i have update then I will post here for all.
Thanks again guys.
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 28 Jun 2011 at 9:37am
consider using Running Totals (using conditional row inclusions) placed on a group footer (or footers with underlay) for converting your rows into columns. Hard to tell not knowing your data but it might work.
Good luck


Edited by DBlank - 28 Jun 2011 at 9:38am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 28 Jun 2011 at 10:37am
I like variables, but even so, it seems a bit on the complex side.
ok, you are running 2 subreports at the same time in the report footer.  You can't use variables as there is only 1 variable call being made, since it is in the report footer.  Basically you are wanting to return 2 tables and create a third table with the sum from the first 2, and variables don't work that way...they are just a number, not....
 
what you need to do is to fill a shared array with the values in sr1 and sr2, then you can add the rows together....but you can't display them as there is only 1 call, at least I don't think you can.
 
The big problem is that you are doing this a section that is only called once and so doesn't lend itself well to what you are looking for.
 
so....
 
Yeah, (like DBlank said), I say use a stored procedure as you can do tons of processing that is completely outside the realm of straight table joins/subreports and return all the data that you know is 'correct' to the report in either 1 big table or smaller tables that link.
 
IP IP Logged
<< Prev  Page  of 2
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