Report Design
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Report Design
Message Icon Topic: Bolding a field based on subreport value?? Post Reply Post New Topic
<< Prev Page  of 2
Author Message
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 04 Mar 2013 at 10:55am
ok so here is what i have
subreport
has the data in GH1( I dont need to surpress)
has the formula:

whileprintingrecords;
shared numbervar totals:=Sum ({@Monday}, {@client})+Sum ({@Tuesday}, {@client})+Sum ({@Wednesday}, {@client})+Sum ({@Thursday}, {@client})+Sum ({@Friday}, {@client})
in GH2

the main report has no grouping
it displays name in the detail section a

and I have the formula

WHILEPRINTINGRECORDS;
SHARED NUMBERVAR TOTalS;
TOTalS

in details b

the whole Idea is that the main report gets me a sample of names
the subreport gets data for each name on the main then totals by day
if the total > 0 then bold the name else regular font



Edited by jbalbo - 04 Mar 2013 at 11:02am
IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 04 Mar 2013 at 11:36am
Sorry, now I think I am getting confused.
INside teh sub report you can place the set up the shared variable anwhere you need to to get it to give you the correct values.
 
I thought you had the sub report set up to run in a footer in main report...
 
where is the sub report set to run in the main report. If you want this to get you values 'for each name' then I think you want your main report grouped on the 'name' field and the sub report to link on the 'name' field and the sub report to be placed in the 'name' group header.
 
If you only run the Sub report once for the entire main report it will only get the shared variable value once. I thnk this is where you are not seeing it 'reset' itself per name.
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 04 Mar 2013 at 12:29pm
Thanks for the info ...


so I took your advice and I groups the main report on name
if gh1 in main I put textbox with name
I also put the subreport in gh1
I redid the formulas using just monday to test
in subreport I created formula

whileprintingrecords;
shared numbervar mondayvalue:=Sum ({@Monday}, {@client})

and in main formula
whileprintingrecords;
shared numbervar mondayvalue;
mondayvalue

in sub
 formula sits in details while
data to display is in gf1(Grouped on name)


in main

I but the formula for mondayvalue in the detail section

its seems its OK (I think) but now the name seems to be one off

so the first monday value is 6 and name is not bolded
next name is bolded even though its 0

IP IP Logged
DBlank
Moderator
Moderator


Joined: 19 Dec 2008
Online Status: Offline
Posts: 9053
Quote DBlank Replybullet Posted: 05 Mar 2013 at 3:51am
youa re trying tot bold thename in the GH1a?
switch the sub report to be in GH1a and the name to be in GH1b.
add the shared variable in teh main report to GH1b. you should see it return the correct value for that group.
IP IP Logged
jbalbo
Senior Member
Senior Member
Avatar

Joined: 17 Feb 2011
Online Status: Offline
Posts: 219
Quote jbalbo Replybullet Posted: 05 Mar 2013 at 4:00am
After if getting late and fustrating, on the ride home I thought of a way to do w/o a sub and its much faster since the sub doesn't need to look at each name individually.
I still need to practice the  sub/main passing of data

AT least I learned alot!!


Thanks
Joe

IP IP Logged
<< Prev Page  of 2
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.030 seconds.