If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Crystal Reports > Passing wrong data from subreport to the main report

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-20-11, 12:19
Dolly Medrano Dolly Medrano is offline
Registered User
 
Join Date: Oct 2009
Posts: 2
Question Passing wrong data from subreport to the main report

I created a subreport to pass data to the main report. I see odd behavior in the main report happens when there is no data in the subreport.
For example the subreport result = 1, the main report shows 1. So the record that has a matching record in the subreport works fine.
When the second record in the main report has no matching record in the subreport the data passed shows 1. #1 keep showing until a record from the main has a matched in the subreport. See the table if it will help what i was trying toexplain here.


Item, Main(Passed from Subreport), Subreport(Data to pass to Main)
aaaa 1 1
bbbb 1 0
ccccc 1 0
dddd 2 2
eeee 2 0
fffff 2 0
gggg 1 1
Reply With Quote
  #2 (permalink)  
Old 01-26-11, 15:16
trowe trowe is offline
Registered User
 
Join Date: Dec 2004
Location: Connecticut
Posts: 85
Until something resets the field, it will show the data from the previous record. When your record has matching data in the subreport, the subreport resets it. When there's no match, the value stays the same as it was and prints out in the next record.

You need to add a calculated field to set the value to null or zero after each record. You can split the record section and hide this calculated field in the part that runs after the section that prints out the value.
Reply With Quote
  #3 (permalink)  
Old 01-26-11, 16:04
Dolly Medrano Dolly Medrano is offline
Registered User
 
Join Date: Oct 2009
Posts: 2
Thank you Trowe for the help. Got my report working now.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On