Solved

Help with sub-reports in Crystal Reports XI

Posted on 2007-03-30
21
428 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
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
 

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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Group Header Repeating on every page 4 45
Crystal Reports--SubReport 3 56
Crystal Report GH Suppress Formula not acting as expected 10 32
free Crystal Report viewer 4 19
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 …
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 shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

773 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