Solved

Subreports won't link to main report properly

Posted on 2011-03-02
12
286 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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
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
 

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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
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…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

778 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