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!

Added subreport to Crystal-Can't Index Fields to Join Tables! 1

Status
Not open for further replies.

twkyoscr

Technical User
Aug 29, 2001
22
US
I have a crystal report that I have added a subreport(datasource is Peoplesoft)to. I need to join EMPLID from the subreport to EMPLID in main report. Crystal will not let me because the fields are not indexed and the option for indexing the fields is grayed out and won't let me select it. I am in Crystal 8.0 and Peoplesoft 8.3, PeopleTools 8.16. Thanks for any help!
 
You shouldn't need an index to link subreprt to main report.

What menu options are you using to get to the window where you are trying to make this link? Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
I am using the visual linking expert and Crystal will not let me join those two fields. If I don't need to join the fields in the tables, how do I get the data from the subreport to flow into the data from the main report? See my example below if this helps!

EMPLID
Name of Employee
Dependent 1
Dependent 2
Dependent 3 with no Social Securty # (subreport)

Name of EE
Dep 1
Dep 2

The way it's running now, the sub report only shows at the end of the entire report. That was my purpose for trying to join the tables-to try to get the dependent with no NID to be listed with an employees other dependents. Thanks for your response Ken!
 
The visual linking expert is within the main report or within the subreport. It doesn't cross between them.

The subreport is a separate report, but you can run it once per employee. Move the subreport to the Group Footer (so that it runs for every employee) and then right click the 'subreport links' option. Select the EmployID from both main and subreports. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Bless you I believe that will work for me! I have one more obstacle though. The main report and the sub report have date range prompts (which would be the same date range each time it's run). Now the prompts are coming up numerous times for the report to complete. How do I get the subreport to use the same date range entered that I would use on the main report? Thanks! You are very helpful!!
 
Right click the subreport and choose Change Subreport Links.

From Available Fields, select the parameter from the main report.

In the menu below (Subreport parameter field to use) use the drop down arrow to reveal a very small scroll bar on the right of the drop down menu. Scroll down until you get to the corresponding parameter on the subreport. (The corresponding parameter will be called {?...} as opposed to {?Pm-?...})

Repeat this process for all the parameters which will be passed to the subreport.

Naith
 
Ok, I tried that but there is no small scroll bar under "Subreport parameter field to use" I can only select from the main report in that drop down( the field from the main report does have ?Pm before the field name). On the far right under the check box for "Select data in subreport based on field", there is the subreport fields but nothing with the ? mark as you described. Also when I select from the main report the ?Pm-Coverage Elect Date(main report), then from the right I select the subreport field for Coverage Elect Date, and run it, the subreport is blank. Any ideas? Thanks for your response--I'm getting closer!
 
You are indeed.

When you were using the drop down menu, Crystal was looking for fields with a similar datatype which it would be possible to link the report to.

Because of this, the subreport parameter and the main report parameter need to be the same. (i.e. both dates, or both datetimes.) The best way to do this is just to copy the main report parameter and paste it in the subreport somewhere. When you go back to the main report and do the link, you can remove the date from where you pasted it in the subreport.

Naith
 
If the prompts are the same data type in sub and main you might hve been fooled by a bug in that drop down. When Naith said small scroll bar he means REALLY small, almost invisible scroll arrows. I spent weeks thinking that there were no scroll bars there.

If there are truly no scroll arrows there when you move over your main report date parameter, then you don't have matching parameter fields in both sub and main. Ken Hamady, On-site Custom Crystal Reports Training & Consulting
Public classes and individual training.
Guide to using Crystal in VB
tek@kenhamady.com
 
Found my problem so I am all set! Thanks all!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top