Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Passing data from sub to mainreport Post Reply Post New Topic
Author Message
Wouter1980
Newbie
Newbie


Joined: 27 Mar 2013
Location: Netherlands
Online Status: Offline
Posts: 6
Quote Wouter1980 Replybullet Topic: Passing data from sub to mainreport
     Posted: 27 Mar 2013 at 9:44pm
Hi,
 
Because of the database i had to make a subreport to get as summery i need in the detailsection of the main report.
 
I made two shared values and placed then in the detail section. In the subreports is everything correct.
All values but the first one is passing through correctly. The first one resluts 0,00 while it also should be 54.5.
Can someone explane why this is? and how i can get this fixed?
thanks
 
 
Verkoopnr Omschrijving PortieKg RecNr Recsub GS1 Gewicht Shared Value 1    
46404 KALFSOESTER 0,545 12547 9943
0
200,00 0,00 MAIN Why 0,00 and not like rest 54,50
                   
RecNr Inhoud receptuur HoeveelHeid Bruto gew Netto Shared Value        
12547 9943 200,00 9,00 9,00 54,50        
12547 8461 8,16 8,16 8,00 54,50   SUBREPORT    
12547 8789 17,86 17,86 17,50 54,50        
12547 15653 20,41 20,41 20,00 54,50        
55,43 54,50                
                   
46404 KALFSOESTER 0,545 12547 8461
0
8,16 54,50 MAIN  
                   
RecNr Inhoud receptuur HoeveelHeid Bruto gew Netto Shared Value        
12547 9943 200,00 9,00 9,00 54,50        
12547 8461 8,16 8,16 8,00 54,50   SUBREPORT    
12547 8789 17,86 17,86 17,50 54,50        
12547 15653 20,41 20,41 20,00 54,50        
55,43 54,50                
                   
46404 KALFSOESTER 0,545 12547 8789
0
17,86 54,50 MAIN  
                   
RecNr Inhoud receptuur HoeveelHeid Bruto gew Netto Shared Value        
12547 9943 200,00 9,00 9,00 54,50        
12547 8461 8,16 8,16 8,00 54,50   SUBREPORT    
12547 8789 17,86 17,86 17,50 54,50        
12547 15653 20,41 20,41 20,00 54,50        
55,43 54,50                
                   
46404 KALFSOESTER 0,545 12547 15653
0
20,41 54,50 MAIN  
                   
RecNr Inhoud receptuur HoeveelHeid Bruto gew Netto Shared Value        
12547 9943 200,00 9,00 9,00 54,50        
12547 8461 8,16 8,16 8,00 54,50   SUBREPORT    
12547 8789 17,86 17,86 17,50 54,50        
12547 15653 20,41 20,41 20,00 54,50        
55,43 54,50                
IP IP Logged
Gurbs
Senior Member
Senior Member
Avatar

Joined: 16 Feb 2012
Location: Ireland
Online Status: Offline
Posts: 216
Quote Gurbs Replybullet Posted: 28 Mar 2013 at 1:45am
Make sure the subreport runs before the place where u want to use the shared variable. If u put the subreport in details B, and the place where u want to use it in details A, it won't work.
IP IP Logged
Wouter1980
Newbie
Newbie


Joined: 27 Mar 2013
Location: Netherlands
Online Status: Offline
Posts: 6
Quote Wouter1980 Replybullet Posted: 29 Mar 2013 at 2:03am
Thnx for your feedback. 
I did put the subreport in the same detail section as the shared value.
As you can see in the printscreen is the value show good in the subreport. receptuur 9943, 8461, 8789, 15653 gives all as shared value 54.50.
But it seems that the results of the shared value in the main report starts alway with a 0 and shift 1 line down.
So receptuur 9943 got 0 and then the other numbers got 54.50.
Do you understand why this is? And what i can do so i got the same results in the main report as in the subreport?
IP IP Logged
Wouter1980
Newbie
Newbie


Joined: 27 Mar 2013
Location: Netherlands
Online Status: Offline
Posts: 6
Quote Wouter1980 Replybullet Posted: 09 Apr 2013 at 11:30pm
Hi,
Is there someone who knows why the shared variable returns 0 for the first match?
In the subreport the shared value is a sum. Could that be the cause?
How i can solve it? Or shift the shared value 1 place up?
thnx
 
 
 
IP IP Logged
Wouter1980
Newbie
Newbie


Joined: 27 Mar 2013
Location: Netherlands
Online Status: Offline
Posts: 6
Quote Wouter1980 Replybullet Posted: 11 Apr 2013 at 4:23am
I tried a few things and found it .
When i put the subreport in the detail section A and the fields of the main report and the shared value in detail section B it works.
 
Probably because of the subreport evaluates so before the main report data.
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