Solved

Subreports won't link to main report properly

Posted on 2011-03-02
12
283 Views
Last Modified: 2012-05-11
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?
0
Comment
Question by:ROTRTechTeam
  • 7
  • 5
12 Comments
 

Author Comment

by:ROTRTechTeam
ID: 35020237
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 35021108
You solved the total issue?

Have you considered using a cross tab for the report?

Are you running from the same database?

mlmcc
0
 

Author Comment

by:ROTRTechTeam
ID: 35021309
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 35021546
No idea unless you have different databases.

How are you calling the report in the web version?

mlmcc
0
 

Author Comment

by:ROTRTechTeam
ID: 35029178
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
 
LVL 100

Expert Comment

by:mlmcc
ID: 35029277
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

Author Comment

by:ROTRTechTeam
ID: 35029371
...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
 

Author Comment

by:ROTRTechTeam
ID: 35029414
Attached is a Word doc with a screenshot of how the date is linked.
SubreportProblem20110303.doc
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 35031946
Are those stored procedure parameters?
If so Crystal doesn't have access to the values.

mlmcc
0
 

Author Comment

by:ROTRTechTeam
ID: 35086533
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
 
LVL 100

Accepted Solution

by:
mlmcc earned 500 total points
ID: 35087277
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
 

Author Comment

by:ROTRTechTeam
ID: 35097838
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

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
This video discusses moving either the default database or any database to a new volume.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now