Subreports won't link to main report properly

I have a report that passes two parameters to the stored proc:

site
datefrom

This report currently does a group by site and then by internalview fields. I get output by the month as follows:

Site 10                   Jan    Feb    Mar    Apr   etc.
  Games                 3        5       2         0      
  Sports                  5        8       9         7
 Total Site 10          8        13     11       7

Site 20                   Jan    Feb    Mar    Apr   etc.
  Games                 1        5       4         3      
  Sports                  5        4       9         4
 Total Site 10          6        9      13       7

I want to do a grand total of each category of internvalview in the report footer.

                              Jan    Feb    Mar    Apr   etc.
  Games                 4         10      6         3      
  Sports                  10      12      18        11
 Gramd  Totals       14        22     24       14



Thus, I took my main report and copied it to be main-sub.rpt.  I then removed the group for site. I then did a subreport insertion and when I try to link I cannot link on site because it does not show up in the subreport.  It isn't in the report fields and it isn't in the database fields lists. I then went back and added the group back and was able to link on it.  I then deleted the group, but the totals are not working properly.

How do I accomplish this?
ROTRTechTeamAsked:
Who is Participating?
 
mlmccConnect With a Mentor Commented:
When you link them are you specifying to select records based on the link?

Where is the subreport in the report?

Can you upload the report?

mlmcc
0
 
ROTRTechTeamAuthor Commented:
An update to this problem:

I added two formulas to the main report that contain just the parameters. I then used these to link to the subreport. In Cyrstal IDE I get the results I expect, but when I run this from my ASP.NET GUI, the subreport has no data at all.  I've added a Word doc that has screenshots showing this situation. What do I do now? Problem-Screenshots.doc
0
 
mlmccCommented:
You solved the total issue?

Have you considered using a cross tab for the report?

Are you running from the same database?

mlmcc
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
ROTRTechTeamAuthor Commented:
No, I managed to get the link working, but when I run in .NET I get no data in the subreport. I had to convert from a cross-tab to a manual cross-tab because the client wants to see 13 months of data, but wants the totals on the right to be just 12 months of data. They also wanted a distinct count of members on the right for just 12 months as well.  I could not do those in a cross-tab (auto) but was able to do so in a manual cross tab.

Any idea why the data shows in the Crystal IDE but not on the web?
0
 
mlmccCommented:
No idea unless you have different databases.

How are you calling the report in the web version?

mlmcc
0
 
ROTRTechTeamAuthor Commented:
Alright, so I managed to get the subreprot to pass through and display data, but it seems to be displaying data from the last time the report was saved.  So if I pick a FROM date of 12/31/2010 and run the report in the IDE and then save it, you can run the report on the web and pick a FROM date of 1/31/2011 and the main report shows 1/31/2011, but the subreport shows the 12/31/2010 data. Ideas?
0
 
mlmccCommented:
Sounds like the subreport is saved with data.

How is the subreport linked to the main report?

Arer records selected based on the link?

mlmcc
0
 
ROTRTechTeamAuthor Commented:
...and I should note that this behavior is NOT present in the Crystal IDE. If I change dates there the subreprot acts like it should.
0
 
ROTRTechTeamAuthor Commented:
Attached is a Word doc with a screenshot of how the date is linked.
SubreportProblem20110303.doc
0
 
mlmccCommented:
Are those stored procedure parameters?
If so Crystal doesn't have access to the values.

mlmcc
0
 
ROTRTechTeamAuthor Commented:
Here is an update and I still need some help. I have managed to get the main report to use the selection formula, but the subreport still won't see the selection formula at all. The two reports work perfectly if I don't try to use a selection formula. They are in synch and work fine. However, when I filter the main report, the subreport still shows all records.
0
 
ROTRTechTeamAuthor Commented:
Well, I've solved this problem. What I did was add a parameter to the stored proc to handle the filtering directly at the SQL level. I then linked the sub-report on those parameters as well as the first two that were already there and everything is working.
0
All Courses

From novice to tech pro — start learning today.