Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked SubReport - results not displaying.

Status
Not open for further replies.

JBourne77

IS-IT--Management
Jan 21, 2008
153
US
I am trying to link a subreport in Crystal and when I try to preview my results, all I get back is blank spaceholders. I have never created a sub-report before, so it may be something very simple.

In my main report, I have called the PatientVisit.PatientVisitId into the report. In my sub-report coding, I coded the same value and tried linking the two between this common unique field. If the value in the subreport is empty, but a record exists in the main report, I would expect the subreport to suppress on this patient.

Essentially, I could not get SQL to handle what I wanted and I had to go the route of a subreport. Linking them still does not help me it seems.
 
on the main design screen, right click on the subreport and click on change subreport links. This is where you link your PatientVisit.PatientVisitId to the same field in the subreport.
 
In the subreport links, I have specified the "Fields to Link to:" to equal Data.PatientVisitId.

Subreport parameter field to use = ?Pm-Data.PatientVisitId

The select data in subreport based on field is checked and its set to "Data.PatientVisitId"

I am still getting nothing when I should have values.
 
As a first step, you should check how each ID field displays to see if the formatting is the same. Also explain in what report section you have placed the subreport. If it is in a group section, is the group based on the ID field?

-LB
 
The subreport is all in one details tab. I suppressed the headers and footers on it and it does not have any groupings.

The main report however is very complex and detailed. I am indeed trying to drop my subreport into Group Footer #3b. It seems that is my issue based on your comment. Maybe?
 
What fields are you grouping on? Is the ID field group #3?

-LB
 
I tried to add the PatientVisitId in as a group and then tried dropping my subreport into that group footer and still did not see my results. I left the borders around it to the single line and left it as can grow so I could see if it was changing on the visits and sure enough the size of the borders would grow on visits that had more entrys, but still nothing was printing in the actual report.

I have 3 groups.

Group 1 is labled "Grouping". In the product, the user can hit a drop down and select amongst several fields and this is what drives that.

My Second group is PatientName. Pretty straightforward.

My third group is TicketNumber. Each distinct visit is assigned a unique ticketnumber, so I want to group the data from the distinct tickets together.

The PatientVisitId is the distinct primary key on my PatientVisit table and this is where my ticketnumber comes from as well. I will stand up and cheer if you can help me get past this fun ... its been a laborsome project and using a subreport seems to be my only choice at this point.
 
I don't know how your fields relate to each other. Can there be multiple ticketnumbers per patientvisitID? If so, then the PatientVisitID group should be Group #3, and ticketnumber group #4, with the subreport in group #3.

Can you verify that if you try to run the sub on its own that it returns the expected results?

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top