Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Shared variables from Sub to Parent Post Reply Post New Topic
Author Message
goztepe2002
Newbie
Newbie
Avatar

Joined: 17 Jan 2013
Location: United States
Online Status: Offline
Posts: 5
Quote goztepe2002 Replybullet Topic: Shared variables from Sub to Parent
     Posted: 09 Sep 2013 at 6:18am
I have a subreport that i am calculating some values at Detail level.

I would like to bring those calculated values into the Main report where Sub report column value matches the Main report column value.

Main

Item StdDev
3     .2


Sub

Item StdDev
2     .5
3     .2


Is this possible ?

IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 09 Sep 2013 at 7:28am
it seems like
this would require much work, as you would need to create 2 formulas in sub report for each Item number.
 something like
subreport
formula 1
if item = 1 then StdDev
formula 2
WhilePrintingRecords;
Shared NUMBERVar Item_1 := Sum ({formula 1 })
mainreport
formula
if item = 1 then item_1 else
if item = 2 then item_2 else
if item = 3 then item_3 else.....

easier way would be to use SQL.
IP IP Logged
goztepe2002
Newbie
Newbie
Avatar

Joined: 17 Jan 2013
Location: United States
Online Status: Offline
Posts: 5
Quote goztepe2002 Replybullet Posted: 09 Sep 2013 at 8:08am
Could you not link the subreport with Item field, then somehow use a variable to update StdDev for respective items ?

Sorry for my ignorance, i am fairly new to Crystal.
IP IP Logged
kostya1122
Senior Member
Senior Member
Avatar

Joined: 13 Jun 2011
Online Status: Offline
Posts: 475
Quote kostya1122 Replybullet Posted: 09 Sep 2013 at 8:22am
it is possible in SQL, but that is the only way i know of in Crystal.
IP IP Logged
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