?
Solved

Crystal Reports Subreport

Posted on 2014-07-31
16
Medium Priority
?
445 Views
Last Modified: 2014-08-01
I have a main report and a subreport where I am passing data from the subreport to the main report using Shared Variable, DateTime and String.  I have created the formulas using WhilePrintingRecords and using Shared in my variable formula.  I have used the same naming from the subreport to the main report.  The subreport is place on details b in the report below the details a row main report.  When refreshing data in the main report the shared formulas from the subreport are not populating data in the main report.  What might I be missing?
0
Comment
Question by:garyjgs
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 8
  • 8
16 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 40232691
The subreport has to be in a section before you want to display the information in the main report.  

When Crystal renders a report, it works from the top down one section at a time. The last thing in each section it evaluates is the subreport. so the values returned aren't available until that section is complete.

To get it in the section you want, you will need to move the subreport up above the main report display of the values

mlmcc
0
 

Author Comment

by:garyjgs
ID: 40232805
I moved the report main fields from details a to details b.  I moved the subreport to details a.  I also moved the subreport to page header.  Refreshed data each time.  The shared variables in the subreport still don't show in the main report.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40232812
DO you declare the shared variables in the main report report header?

Can you upload the report?

mlmcc
0
On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

 

Author Comment

by:garyjgs
ID: 40232862
Crystal Report uploaded.
SCH-11-V2.rpt
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40232884
My first thought is the subreport isn't selecting any records.

mlmcc
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40232894
WHen I preview the report the subreport is blank.

I added a text field to the subreport and it shows.
I added a new formula to set the date to 1 Jan 1900.  That shows in the subreport and in the main report.

Your subreport is not getting any data.

mlmcc
0
 

Author Comment

by:garyjgs
ID: 40232924
I can run the report (subreport) as a stand alone report and I can retrieve data.  When I add it as a subreport, no data.  Not sure why this would be?
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40233036
Are you filtering it the same way when you run it standalone?

As a subreport you have an added filter on the PO Number.  I took the link off which should have removed that filter and still get no data but since it has to use saved data that is probably why nothing changes.

Try taking the link off the subreport and refresh the report

mlmcc
0
 

Author Comment

by:garyjgs
ID: 40233098
I did remove the filter and same results.  I took off "saved with data" and refreshed.  No subreport data.  As two stand alone reports, both return data.  When adding either as a subreport to either one, subreport does not return data.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40233397
No idea.  Something seems to be filtering the data.

mlmcc
0
 

Author Comment

by:garyjgs
ID: 40234572
I think that I have figured this out.  The data in the primary report is not the same in the subreport.  For example, PO Number in the primary report is 100005 and the corresponding value is 1000005.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 40234589
That would be the issue when you link them but it shouldn't matter when you have one just inserted into the other and not linked.

mlmcc
0
 

Author Comment

by:garyjgs
ID: 40234607
When I unlinked it again this morning, I used data from the subreport from the first page of the subreport and used the parameter in the subreport.  Results were returned in the subreport.  I used that same value in main main report and no results were returned when using the parameter.  I am working in a test environment remotely.    It appears when you look at the data there should be a match.  However, I am beginning to believe that the same data does not exist in both tables that I am trying to link via subreport.
0
 
LVL 101

Accepted Solution

by:
mlmcc earned 2000 total points
ID: 40234640
That would be a problem.  I have seen that all too often with test data since quite often it isn't entered through the application the way it is in production.  Many times data is just entered into the tables and typos occur.

mlmcc
0
 

Author Comment

by:garyjgs
ID: 40234664
Thanks for looking at this.  I was happy to have you give it a second look.   Another set of eyes always help.
0
 

Author Closing Comment

by:garyjgs
ID: 40234666
Thank you.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question