Solved

Help with sub-reports in Crystal Reports XI

Posted on 2007-03-30
21
426 Views
Last Modified: 2008-02-01
Hi,

I'm trying to put together a CR XI sub-report for a report in an ASP.NET application, and I'm having difficulty...  I don't understand how fields in the sub-report are linked to the main one.  I've tried a couple of things, but had no luck with making data appear.

I know I must be doing _something_ right: I have created a combined lastname, firstname text field in the details section of the sub-report.  The data isn't showing, but the comma that I use to separate the fn and ln is showing up twice in the preview, consistent with the exptected number of records to be returned.

I have tried using the Subreport Links dialog to establish links between the main and sub reports.  But when I try to establish a link between the only the lastname fields from the main report to the same field in the sub-report, nothing shows when I preview it.  In fact, the two commas mentioned above are gone, replaced by only one comma.

Please help-

0
Comment
Question by:jgerbitz
  • 13
  • 7
21 Comments
 

Author Comment

by:jgerbitz
ID: 18826043
Update:

When I remove the GroupBy on the subreport, the names show up fine.  Somehow the Group needs to be linked...
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18826577
The link between the main report and the subreport establishes a filter for the subreport.  It shouldn't have anything to do with the grouping.

What are you trying to group by?

mlmcc
0
 

Author Comment

by:jgerbitz
ID: 18826717
I think I have figured it out, the grouping seems to be working now.... finally.

Could I ask you to answer this for me?  The group by name is simply the index referring to a record in another table.  How can I get the name in the table to show instead of the index?

For example, in the Group Name#1 field, I have a single integer between 1 and 9 showing.  I'd like this to show the name that the integers are referring to from another table.  Instead of 3, show 'Arrhythmia'.  Normally, it would be easy to construct a SQL statement, but that doesn't work...
I tried to construct a formula in the 'display string' dialog when I right click on the Group Name #1 field --> Format Object --> Common tab --> Display String, but I'm having issues.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18827286
WHen you set the group you can select a different field for the name.
Right click the group header left margin
Click CHANGE GROUP
Click CUSTOMIZE GROUP OPTIONS
Click use a field
Select the field from the drop down

mlmcc
0
 

Author Comment

by:jgerbitz
ID: 18837258
I think I need a formula of some kind.
When I run the report, the Group Name#1 field shows as a "5".  I need it to say "Excessive Bleeding", which is record #5 in another table in SQL Server.

(SELECT "OutcomeCode"."OutcomeCodeName" WHERE "OutcomeCode"."OutcomeCodeID" = '5')

Obviously the '5' needs to be the Group Name#1 field, so that the OutcomeCodeName changes for each separate group of outcomes.  But I'm not sure how to do this.

Thanks
0
 

Author Comment

by:jgerbitz
ID: 18837932
Should this be done in the "Display String" formula field in the Format Editor?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18838016
Do you have the outcomecode table in the report?
You should be able to drag the name field onto the report

mlmcc
0
 

Author Comment

by:jgerbitz
ID: 18838878
I do have the OutcomeCode table in the report.  I dragged it onto the report but nothing appears in the preview...  I double-checked the links, deleted them, re-created them and made them all LEFT OUTER JOINS.  This is what helped me the last time I was running into a similar problem.

I followed your lead from your post on Friday under  CUSTOMIZE GROUP OPTIONS.  But I chose 'Use a Formula as Group Name' instead of choosing OutcomeCodeName from the drop down list.
As a formula I simply dragged OutcomeCodeName into the box.  It's probably the same as picking that field from the ddl, but thought I'd try it.
0
 

Author Comment

by:jgerbitz
ID: 18839409
One thing:  while browsing the fields in the join table between the OutcomeCode table and the PatientComplete View from SQL (right-clicking on a field --> browse field), neither of the PatientID or OutcomeCodeID foreign key fields are displaying any data.  
0
 

Author Comment

by:jgerbitz
ID: 18840012
....which makes sense since the fields are in an association table used to break up a many-to-many relationship between the OutcomeCode and PatientComplete tables.

Do I actually need data in the association table?  (I hope not, what would be the point of links?)
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:jgerbitz
ID: 18840396
mlmcc-- (I hope you haven't given up on me!)

Another thing: do I need to explicitly include the OutcomeCodeName field in the "Fields to link to" box in the Subreport Links dialog if I want to use them?
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18840554
Haven't given up on you.  Tool advantage of the nice weather here to fix a leaky roof.

You can use the field to link if that is the field to link with. I doubt that it is.

mlmcc
0
 

Author Comment

by:jgerbitz
ID: 18844729
I don't know why this is giving me so much trouble.  I should just be able to drag the OutcomeCodeName onto the report.  The links between the tables should be able to interpret the numbers that are showing up in the Group headers as the corresponding OutcomeCodeName...!  What gives?

I've included links to images of the table links and what the report looks like... hopefully it helps.

Image of the table links: http://img117.imageshack.us/img117/2894/linksfa0.jpg

Image of the sub-report preview: http://img110.imageshack.us/img110/5069/groupingsss4.jpg
(all fake testing data)

Thanks again-
0
 

Author Comment

by:jgerbitz
ID: 18844746
hope you got your roof fixed!
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18845883
Why is the link FROM the OutcomeCode table to the i_PatientOutcome.  It should go the other direction.

mlmcc
0
 

Author Comment

by:jgerbitz
ID: 18846589
I changed the direction, then right-clicked on Group Name --> Format Object --> Display String (Formula) and dragged OutcomeCodeName field onto the editor.  Saved / closed it and previewed the report.     The groupings remain the same, but the group header is now invisible  --> neither the OutcomeCode nor the OutcomeCodeName are showing.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18847610
Have you tried to VERIFY THE DATABASE under the DATABASE menu?

mlmcc
0
 

Author Comment

by:jgerbitz
ID: 18851639
Yes, no change.
0
 
LVL 100

Expert Comment

by:mlmcc
ID: 18851857
I am stumped.

mlmcc
0
 

Accepted Solution

by:
jgerbitz earned 0 total points
ID: 18853055
Could you close this thread?  I'll try again with a rephrased question, hopefully someone will be able to help.
Thanks again-
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…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

708 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

15 Experts available now in Live!

Get 1:1 Help Now